sp_preprexec error
Hello,
I am receiving the following error when sending a paramaterized statement
from a web page to SQL Server via ODBC connection
Msg 8179, Level 16, State 2, Procedure sp_prepexec, Line 1
Could not find prepared statement with handle 1.
Here is the captured statements received by SQL server (captured by Profiler):
declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,N'@P1 nvarchar(5)',N'SELECT userid
FROM usertable
WHERE username = @P1
',N'admin'
select @p1
The odd thing is, if I copy and paste into Query Anylzer, and comment out
line 2 (set @p1=1), it works fine.....uncomment line 2 and I get the same
error.
Can anyone tell me the cause of this and a possible work around? I don't
know how to tell the CGI script on the web page not set a value of @p1 (not
sure it is even responsible for doing it).
Thanks,
Mark
date: Wed, 11 Jun 2008 17:34:00 -0700
author: Mark