|
|
|
Forum Guru
      
участник
Last Login: 16.11.2006 17:16
Сообщ.: 68,
Visits: 746
|
|
Из клиентского приложения a вызываю хранимую процедуру, но она не выполняется. Пробовал различные варианты параметров в приложении при вызове процедуры, но итог тот же.
Профайлером увидел, что происходит следующий вызов в трех разных случаях в зависимости от параметров на клиенте
declare @P1 int
set @P1=NULL
declare @P2 int
set @P2=0
declare @P3 int
set @P3=0
exec sp_cursorprepexec @P1 output, @P2 output, NULL, N'exec at_get_OKOPF 0', 8, 1, @P3 output
select @P1, @P2, @P3
declare @P1 int
set @P1=NULL
declare @P2 int
set @P2=0
declare @P3 int
set @P3=0
exec sp_cursorprepexec @P1 output, @P2 output, NULL, N'exec at_get_OKOPF 0', 16, 1, @P3 output
select @P1, @P2, @P3
declare @P1 int
set @P1=1
exec sp_prepexec @P1 output, NULL, N'exec at_get_OKOPF 0'
select @P1
В первых двух случаях получаю ошибку
Server: Msg 16937, Level 16, State 1, Procedure at_get_OKOPF, Line 1
A server cursor is not allowed on a remote stored procedure or stored procedure with more than one SELECT statement. Use a default result set or client cursor.
Server: Msg 8180, Level 16, State 1, Procedure sp_cursorprepexec, Line 7
Statement(s) could not be prepared.
В третьем случае
Server: Msg 8179, Level 16, State 2, Procedure sp_prepexec, Line 3
Could not find prepared statement with handle 1.
Помогите разобраться, плз.
Спасибо!
|
|
|
|
|
Supreme Being
      
модератор
Last Login: 29.10.2007 14:45
Сообщ.: 1 833,
Visits: 16 863
|
|
| Не уверен, что поможет, но в начале процедуры попробуй поставить SET NOCOUNT ON.
|
|
|
|