dcsimg
 

Submitted by: Hannes du Preez(ojdupreez1978@gmail.com)

Thursday Aug 23rd 2018 by Hannes du Preez

Language: SQL, Expertise: Advanced - See how to determine the oldest transaction in SQL.

You can obtain the oldest Open Transaction in the following way:

-- Create temporary table for results.  
CREATE TABLE #OpenTrans (  
   CurrTrans VARCHAR(25),  
   CurrTransDet SQL_VARIANT   
   );  

-- Insert info in temp Table  
INSERT INTO #OpenTrans 
   EXEC ('DBCC OPENTRAN WITH TABLERESULTS, NO_INFOMSGS');  

-- Display results.  
SELECT * FROM #OpenTrans;
Home
Mobile Site | Full Site
Copyright 2018 © QuinStreet Inc. All Rights Reserved