CREATE TABLE T1(Col1 int,Col2 char(3)); GO BEGIN TRAN INSERT INTO T1 VALUES (101,'abc'); GO DBCC OPENTRAN; ROLLBACK TRAN; GO DROP TABLE T1; GO
下面是结果集:
Transaction @R_40_4045@ion for database 'master'.
Oldest active transaction:
SPID (server process ID) : 52
UID (user ID) : -1
Name : user_transaction
LSN : (518:1576:1)
Start time : Jun 1 2004 3:30:07:197PM
SID : 0x010500000000000515000000a065cf7e784b9b5fe77c87709e611500
下面的示例将 DBCC OPENTRAN 命令的结果加载到临时表中。
-- Create the temporary table to accept the results. CREATE TABLE #OpenTranStatus ( ActiveTransaction varchar(25),Details sql_variant ) -- Execute the command,putting the results in the table. INSERT INTO #OpenTranStatus EXEC ('DBCC OPENTRAN WITH TABLERESULTS,NO_INFOMSGS'); -- display the results. SELECT * FROM #OpenTranStatus; GO
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。