Reputation: 90851
I have just inherited a server application, however it seems that the only copy of the database is corrupt and the working version is gone, so is it possible to find what queries the application is running so I can try to rebuild the tables?
Edit: I have some files with no extensions that I are named the same as the databases, IDK if there is anything that can be done with them but if anyone has any ideas.
The accepted answer seems the most likely to succeed however I was able to find another backup so I have not tested it.
Upvotes: 2
Views: 340
Reputation: 25197
You could RegEx the files to search for
Upvotes: 0
Reputation: 35267
Look for SQL Profiler, which (depending on which version you have) is normally available from the tools menu in query analyzer (isqlw.exe) or management studio (in later versions).
With SQL profiler you can run a trace on the server which can show you which queries are being requested by the application.
Upvotes: 2
Reputation: 27528
If you have access to either a unix machine, or can install the cygwin utilities (http://www.cygwin.com/), there is a command called 'strings' which will search through any file type and print out any contiguous sequence of character data (might just be ascii). That tool should help you identify the sql queries embedded in the aplication.
Upvotes: 2
Reputation: 577
You could run the UNIX command "strings" on the program to see whether it has embedded sql strings:
http://en.wikipedia.org/wiki/Strings_(Unix)
Upvotes: 0
Reputation: 83021
Turn on SQL query logging and watch what the application asks for.
Upvotes: 3