views:

340

answers:

4

I'd like to be able to hook into a 3rd party application to see what SQL Statements are being executed. Specifically, it is a VB6 application running on SQL Server 2005.

For example, when the application fills out a grid, I'd like to be able to see exactly what query produced that data.

+11  A: 

If you have the appropriate rights (sysadmin or ALTER TRACE permission) on the DB you could watch using SQL Profiler.

Kev
+1  A: 

If the application does not write a log or something, the only way to watch them is on the database side. SQL Profiler is the proper tool for the task on MSSQL 2005.

Vinko Vrsalovic
+1  A: 

You can view it server side by connecting to the SQL server with the SQL Server Profiler included in the tools. Here's a usage run down of it from Microsoft

Nick Craver
A: 

Reviewing it on the server as other answers indicate is most likely the best way to go. However, if that's not available, you can also turn on ODBC logging which may be helpful.

Knox