Is there a tool for windows that we can use to inspect any SQL commands that go through a particular ODBC data source?
You can make ODBC log out everything it's doing:
http://support.microsoft.com/kb/274551
http://msdn.microsoft.com/en-us/library/ms711020%28VS.85%29.aspx
You can also do it programmatically:
... One can do this by calling
SQLSetConnectAttr
and set theSQL_ATTR_TRACE
attribute in the connection toSQL_OPT_TRACE_ON
. So, by doing this you would be enabling/disabling it for the connection duration.
http://decipherinfosys.wordpress.com/2009/01/17/odbc-tracing/
If you're using SQL Server, look at the SQL Server Profiler. Profiler allows you to monitor/trace all communications between your application and the SQL Server, including which procedures are called, parameter values, etc, without having to modify your application.
If you're using a different server, you should be able to find a sql proxy that will do the same thing.
Generally it is advisable that your ODBC application not be running when you enable ODBC tracing, such that when it starts it can pick up the tracing option having been enabled and then perform the tracing.
Note OpenLink Software provide an ODBC tracing tool calle OpenLink Scan for providing detailed ODBC tracing and Metadata analysis on 32bit windows, which can be downloaded from:
Best Regards
OpenLink Software