Search code examples
c#sql-serverparameterized-query

Finding the SQL output of a parameterized query


I'm making a parameterized query using C# against a SQL server 2005 instance, and I'd like to take a look at the SQL that is run against the database for debugging purposes. Is there somewhere I can look to see what the output SQL of the parameterized command is, either in the database logs or in the Visual Studio debugger?


Solution

  • Use SQL Server Profiler to view the sql

    http://www.eggheadcafe.com/articles/sql_server_profiler.asp

    http://msdn.microsoft.com/en-us/library/ms187929(SQL.105).aspx