Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Profiler and dynamic SQL

Author  Topic 

awheeler_01
Starting Member

4 Posts

Posted - 2008-05-23 : 16:12:23
I am using serveral stored procedures that create a linked server with a machine name that is unknown and hence must be parameterized the schema name is also unknown and also is a parameter to the procedure; this necessitates that the query I use within the context of the linked server must by dynamic (I create a string and then use sp_executeSql to execute the dynamic sql. When I try to use the profiler to get information about said dynamic sql there is no output other than EXEC @RetVal = sp_executesql @strSelect within the output window. Does anyone know of a way to get more information from the profiler for dynamic sql run within a Stored procedure?

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-23 : 22:38:55
Did you choose sp:stmtstarting, sql:stmtstarting and related events in trace?
Go to Top of Page

awheeler_01
Starting Member

4 Posts

Posted - 2008-05-27 : 14:05:27
Thank you, that is exactly what I needed.
Go to Top of Page
   

- Advertisement -