I am reversing a closed-source legacy application that uses Microsoft SQL Server (2005) and I would like to find out precisely what queries are being executed in the background. I understand that it may be possible to use Wireshark to view the network traffic, but it feels quite clumsy so I am looking for something more specialized for this purpose. Is there a tool that is similar to Firefox's Tamper Data, but for MSSQL to view, and possibly edit queries?Features that I am looking for:Able to view queries precisely as executed by the application (including blobs etc.)Features that would be very useful:Able to intercept query execution and allow edits to the value
Viewing MSSQL transactions between closed-source application and server
windows;mssql
Most databases are very friendly to tracing and profiling while the database is running. You need to do very little actual reverse engineering. There's a program called SQL Server Profiler which I believe can dump every single query executed against the database. If you don't have access to the server it becomes a bit more complicated.If your application is using ADO you might be able to use Statement tracer for ADO.A more complex way of doing what you want depends on what sort of database layer your application is using. If the layer is COM based (OLE DB is), then you have two options, either drill into the COM interface or create a COM proxy. I would probably simply hook the objects which derive from the various OLE DB ICommandXXX interfaces.