2

So, I got this:

enter image description here

A simple trace with user errors.

But, how can I know the query that has the problem listed here?

I don't think DBCC INPUTBUFFER(X) is appropriated to this.

EDIT 1:

Well, I'm using:

STORED PROCEDURES:

  1. RPC: COMPLETED
  2. RPC: STARTING
  3. SP: COMPLETED
  4. SP:STARTED

TSQL:

  1. SQL:StmtCOMPLETED
  2. SQL:StmtSTARTED

And I can see this now:

enter image description here

is there a better approach for this?

I could find the query, because it was the only statement using TOP.I think it was luck.

4

I would add the events SQL:BatchStarting and/or SP:StmtStarting as well. That way, you can compare the SPID (the session ID) and find which query executed on which SPID.

For the record, Profiler is being replaced by Extended Events (XE for short) as of SQL Server 2008, though the GUI is really only usable as of 2012 in my opinion.

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .