Batch statement produces error
Posted: Wed 19 Nov 2014 19:57
I met this bug in old editions, then it has been fixed. Now it returned back.
Execute simple statement:
Error messages will be shown:
dbForge executes 3 queries:
dbForge Studio for SQL Server 4.0.35
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)
Apr 2 2010 15:48:46
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2)
Execute simple statement:
Code: Select all
SELECT * FROM sys.tables;
SELECT * FROM sys.views;
SELECT @@version;
Code: Select all
SQL.sql: Error (5,1): sp_cursoropen/sp_cursorprepare: The statement parameter can only be a batch or a stored procedure with a single select, without FOR BROWSE, COMPUTE BY, or variable assignments.
SQL.sql: Error (1,1): Procedure sp_cursoropen. The cursor was not declared.
Query opened in 0.203s [0.199s exec, 0.004s fetch]
Code: Select all
declare @p3 int
set @p3=0
declare @p4 int
set @p4=0
exec sp_executesql N'declare @handle int, @rows int
exec sp_cursoropen @handle OUT,N''SELECT * FROM sys.tables;
SELECT * FROM sys.views;
SELECT @@version;'',1, 1, @rows OUT;
select @handler=@handle; select @rowCount=@rows',N'@handler int output,@rowCount int output',@handler=@p3 output,@rowCount=@p4 output
select @p3, @p4
Code: Select all
SET FMTONLY OFF; SET NO_BROWSETABLE ON;SELECT * FROM sys.tables;
SELECT * FROM sys.views;
SELECT @@version; SET NO_BROWSETABLE OFF;
Code: Select all
SELECT * FROM sys.tables;
SELECT * FROM sys.views;
SELECT @@version;
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)
Apr 2 2010 15:48:46
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2)