August 26, 2008 at 7:16 am
When I run SELECT statements from SQL from SQL 2000 Ent. Mgr I am not seeing it captured in my server side trace. I typically capture Stored Procedure info and thier nested SQL statements in my traces w/ no issues; now I'm trying to capture Dynamic SQL issued from an application - in this case, Ent. Mgr
(List of trace event here: http://msdn.microsoft.com/en-us/library/ms186265.aspx
I am capturing the following trace events in my trace definition:
-- 10 RPC:Completed : indicates that a remote procedure call has been completed
-- 12 SQL:BatchCompleted : indicates that the Transact-SQL batch has completed
-- 13 SQL:BatchStarting Occurs when a Transact-SQL batch has started.
-- 19 DTCTransaction Tracks Microsoft Distributed Transaction Coordinator (MS DTC) coordinated
-- transactions between two or more databases.
-- 40 SQL:StmtStarting Occurs when the Transact-SQL statement has started.
-- 41 SQL:StmtCompleted Occurs when the Transact-SQL statement has completed.
-- 44 SP:StmtStarting Indicates that a Transact-SQL statement within a stored procedure has started executing.
-- 45 SP:StmtCompleted Indicates that a Transact-SQL statement within a stored procedure has finished executing.
-- 46 Object:Created Indicates that an object has been created, such as for CREATE INDEX, CREATE TABLE,
-- and CREATE DATABASE statements.
-- 47 Object:Deleted Indicates that an object has been deleted, such as in DROP INDEX and
-- DROP TABLE statements.
-- 53 CursorOpen Indicates when a cursor is opened on a Transact-SQL statement by ODBC, OLE DB,
-- or DB-Library.
-- 70 CursorPrepare Indicates when a cursor on a Transact-SQL statement is prepared for use by ODBC,
-- OLE DB, or DB-Library.
August 26, 2008 at 7:59 am
Think I figured this out. this DB has just 2 databases on it. I had the SQL Trace filter set ON:
EXEC sp_trace_setfilter @TraceID, 3, 1, 0, 7 -- Filter: include databaseId = 7 (7=MyDatabase)
For whatever reason, even though my SQL was operating on MyDatabase, with the Filter set on, it was NOT capturing the SQL in the trace file. I commented out the setfilter statement and I'm now seeing the SQL which ran against MyDatabase.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply