Comments
3 comments
-
I have noticed that sometimes running queries results in a parameterized query being submitted behind the scenes. You can see the same behavior if you run a MS SQL Profiler session against the database. Particularly, I think ODBC connections (as opposed to connections that use the native MSSQL driver) transform the simple version of the query into one with parameters.
Hope this helps. -
Brian Donahue wrote:I have noticed that sometimes running queries results in a parameterized query being submitted behind the scenes. You can see the same behavior if you run a MS SQL Profiler session against the database. Particularly, I think ODBC connections (as opposed to connections that use the native MSSQL driver) transform the simple version of the query into one with parameters.
Hope this helps.
Brian,
If the client were using ado.net insetad of ODBC would help? Do you know if there is anything that can be done at the SQL Server end to change this or is this just one of those things you're stuck with?
Thanks -
It's the way that the client works. I do not know enough about the internals of SQL native client and/or ADO to say how to avoid it.
Add comment
Please sign in to leave a comment.
#1:
INSERT INTO [dbo].[MYTABLE]( @col1, @col2, @colN)
VALUES (1, 'a', 'WhatThe')
#2:
(@1 int,@2 varchar(1),@3 varchar(256) ) INSERT INTO [MYTABLE]( @col1, @col2, @colN)
VALUES (@1, @2, @3)