tags:

views:

837

answers:

1

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:

  1. Prepare a query in the from of "SELECT foo FROM foo_table WHERE id = ?", send it to the server (and get an identifier back).
  2. 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
Thanks for the info! :-)ASP can be lame.
It has nothing to do with ASP. This is the general way things go with parametrized queries.
Tomalak