Profiling statements inside a User-Defined Function

Posted by Craig Walker on Stack Overflow See other posts from Stack Overflow or by Craig Walker
Published on 2010-03-12T20:16:42Z Indexed on 2010/04/15 19:03 UTC
Read the original article Hit count: 376

I'm trying to use SQL Server Profiler (2005) to track down some application performance problems. One of the calls being made is to a table-valued user-defined function. This function wraps a select that joins several tables together.

In SQL Server Profiler, the call to the UDF is logged. However, the select that underlies the UDF isn't being logged at all. Because of this, I'm not getting useful data on which tables & indexes are being hit. I'd like to feed this info into the Database Tuning Advisor for some indexing advice.

Is there any way (short of unwrapping the queries themselves) to log the tables called by UDFs in Profiler?

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2005