How can I view the SQL code of my query after it has been parameterized by Parameters.Append
A:
You can't.
Parametrized Queries are not built like a string that you could output when ready.
It's always a two-step process:
- Prepare a query in the from of "SELECT foo FROM foo_table WHERE id = ?", send it to the server (and get an identifier back).
- Send all the parameters to fill the question marks to the server, along with the identifier of the prepared statement.
At no point in time the two (query and parameters) get in touch outside of the database server. (This is the reason why parametrized queries are much more secure than hand-made SQL strings).
Tomalak
2009-02-06 08:10:41
Thanks for the info! :-)ASP can be lame.
2009-02-06 16:31:45
It has nothing to do with ASP. This is the general way things go with parametrized queries.
Tomalak
2009-02-06 16:35:18