dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

how to trace a given t-sql-statement? - sqlserver-tools

This is a discussion on how to trace a given t-sql-statement? - sqlserver-tools ; hi, in order to troubleshoot a given scenario i have to find out, which stored procedure, etc. is firing as a specific piece of t-sql code (which has been written by different people). how can i figure this out? i ...


Home > Database Forum > Microsoft SQL Server > sqlserver-tools > how to trace a given t-sql-statement?

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-13-2008, 03:40 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default how to trace a given t-sql-statement?

hi,

in order to troubleshoot a given scenario i have to find out, which stored
procedure, etc. is firing as a specific piece of t-sql code (which has been
written by different people). how can i figure this out? i am aware of sql
profiler, but in case this is the right tool, what to to do in detail/which
event is to monitor and how can i trace only, if the given t-sql statement
is fired assuming tons of t-sqls are fired a day?

or - if sql profiler is the wrong tool - here, how to proceed instead?

--
thanks in advance / danke im voraus - fritz

Fritz Theiss

Reply With Quote
  #2  
Old 11-13-2008, 07:15 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: how to trace a given t-sql-statement?

Fritz Theiss (fritz@anywhere.com) writes:
> in order to troubleshoot a given scenario i have to find out, which
> stored procedure, etc. is firing as a specific piece of t-sql code
> (which has been written by different people). how can i figure this out?
> i am aware of sql profiler, but in case this is the right tool, what to
> to do in detail/which event is to monitor and how can i trace only, if
> the given t-sql statement is fired assuming tons of t-sqls are fired a
> day?


You could set up a filter on TextData that includes some text from this
piece of code. Assuming that you know what code you are looking for
that is.

It could help if you describe you scenario in little more detail. Is this
T-SQL code a SELECT or an update action?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 11:06 AM.