views:

19

answers:

1

I have a database upgrade tool that is misbehaving. I would like to catch one of the queries it sends to the database and change it before it is executed.

The tool connects via ODBC.

The tool and the SQL Server are on the same Windows 2003 Server box.

Any ideas?

EDIT: (More info) When the tool runs it dies on step 12 out of 100. It issues some bad SQL intended to create a view. I need to suppress the error message or correct the SQL before it is executed. I can't just create the view because the first thing it does it drop the view. Even then it would error because the view would already exist.

+2  A: 

Certainly - use the SQL Profiler to intercept and record the query.

Very useful little tool that...

Martin Milan
I can watch the query come in using the Profiler (I love that tool) but I need to change it before it runs. The tool is creating SQL with syntax errors that need to be fixed. I want to do a man in the middle setup where I can monkey with every thing the tool does. Or set the server to replace the query.
NitroxDM
Is there an option in the Profiler I'm missing?
NitroxDM
@NitorxDM: no, you can't change it in profiler. You can copy it into SSMS and change it and run it
gbn
@gbn - That is what I thought. Too bad running it again wouldn't fix the issue.
NitroxDM