J
Jeff Jarrell
In the old days before sql injection attacks our apps would just build
strings and execute them. If the query threw an exception the evaluated
query string would be displayed\logged. From the log the analyst could
simply cut and paste into query analyzer and see what was wrong and
ultimately work towards fixing it.
Now we are re-writing and coding with parameters i'd like to be able to see
the same thing. For instance, the exception that says "incorrect syntax
near =" and you have no idea near what. In the old days I would simply add
the query to the message and you could readily see in the exception what is
wrong. I.e. an apostrophe in the user data (which hadn't been escaped for).
In my first foray into this I went into SQL Profiler and pulled out the
statement. I need the evaluated statement in the log. (I guess I could
build it myself, but then that wouldn't be exactly what sql sees now would
it?)
Any ideas?
strings and execute them. If the query threw an exception the evaluated
query string would be displayed\logged. From the log the analyst could
simply cut and paste into query analyzer and see what was wrong and
ultimately work towards fixing it.
Now we are re-writing and coding with parameters i'd like to be able to see
the same thing. For instance, the exception that says "incorrect syntax
near =" and you have no idea near what. In the old days I would simply add
the query to the message and you could readily see in the exception what is
wrong. I.e. an apostrophe in the user data (which hadn't been escaped for).
In my first foray into this I went into SQL Profiler and pulled out the
statement. I need the evaluated statement in the log. (I guess I could
build it myself, but then that wouldn't be exactly what sql sees now would
it?)
Any ideas?