現跟蹤sql server,會時不時會調用
exec sp_primary_keys_rowset N'table', NULL
exec sp_indexes_rowset N'table', NULL, NULL
過程,不知它在什么情況會調用,正有查...
http://www.itpub.net/553384.html
[@more@]The following shows sample output from a SQL Profiler trace:
Event Class Event Sub Class Text Connection ID SPID
+DTCTransaction enlisting 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158468 9
+DTCTransaction active 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158468 9
+DTCTransaction propagate transaction 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158468 9
+SQL:BatchCompleted SELECT au_lname from authors GROUP BY au_lname 1158468 9
Connect 1158472 10
ExistingConnection 1158472 10
+SQL:BatchCompleted SET NO_BROWSETABLE ON 1158472 10
+RPC:Starting sp_prepare @P1 output, NULL, N'SELECT * FROM Authors', 1 select @P1 1158472 10
+RPC:Completed sp_prepare @P1 output, NULL, N'SELECT * FROM Authors', 1 select @P1 1158472 10
Disconnect 1158472 10
Connect 1158473 10
ExistingConnection 1158473 10
DTCTransaction get address 1158473 10
+DTCTransaction idle 05fd00a5-3b2a-11d5-aea6-0080c7c71171 1158473 10
DTCTransaction propagate transaction 1158473 10
+RPC:Starting [pubs]..sp_primary_keys_rowset N'Authors', NULL 1158473 10
+RPC:Completed [pubs]..sp_primary_keys_rowset N'Authors', NULL 1158473 10
+DTCTransaction drain abort 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158473 10
+DTCTransaction aborting 05fd00a7-3b2a-11d5-aea6-0080c7c71171
+DTCTransaction idle 05fd00a7-3b2a-11d5-aea6-0080c7c71171 1158473 10
+DTCTransaction propagate transaction 05fd00a7-3b2a-11d5-aea6-0080c7c71171
This shows that a simple SELECT statement with a GROUP BY clause is executed on a session. It is briefly prepared (in an attempt to collect meta data), and then a new connection is made for requesting primary key information from the table. The new connection is (incorrectly) enlisted in the transaction, which aborts immediately after the sp_primary_keys_rowset call is made.
After the drain abort entry, the application stops responding for the length of the transaction timeout.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7232662/viewspace-837126/,如需转载,请注明出处,否则将追究法律责任。