You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I run my sql file, I get the error "'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.". In the query history, I can see multiple entries were added based on my use of ; at the end of a query. There are no batch separators in the query history 'GO'. The file runs fine in other editors such as Azure Data Studio for example.
To Reproduce
Steps to reproduce the behavior:
Run the file against a MSSQL DB.
Expected behavior
Two rows containing a and b.
Desktop (please complete the following information):
SQLTools Version [e.g. v0.17.x] v0.28.3
VS Code Version: [e.g 1.x.y] 1.94.1
OS: [e.g. Windows, Linux, Mac] MacOS Sequoia 15.1
Driver:
PostgreSQL/Redshift
MySQL/MariaDB
MSSQL/Azure
SQLite
Other? Which...
Database version: [e.g. MySQL v5.6, PostgreSQL vX...]
Microsoft SQL Server 2014 (SP3-GDR) (KB5029184) - 12.0.6179.1 (X64)
Jul 27 2023 21:44:30
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)
Test File.SQL
`
SET ANSI_NULLS ON
GO
;
SET QUOTED_IDENTIFIER ON
GO
;
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[Test_WS_Rpt_SubOptCodesSp1]')
AND type IN (N'P', N'PC')
)
DROP PROCEDURE [dbo].[Test_WS_Rpt_SubOptCodesSp1]
GO
;CREATE PROCEDURE [dbo].[Test_WS_Rpt_SubOptCodesSp1] (@item ItemType)
AS
BEGIN
Describe the bug
When I run my sql file, I get the error "'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.". In the query history, I can see multiple entries were added based on my use of ; at the end of a query. There are no batch separators in the query history 'GO'. The file runs fine in other editors such as Azure Data Studio for example.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Two rows containing a and b.
Desktop (please complete the following information):
Jul 27 2023 21:44:30
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)
Test File.SQL
`
SET ANSI_NULLS ON
GO
;
SET QUOTED_IDENTIFIER ON
GO
;
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[Test_WS_Rpt_SubOptCodesSp1]')
AND type IN (N'P', N'PC')
)
DROP PROCEDURE [dbo].[Test_WS_Rpt_SubOptCodesSp1]
GO
;CREATE PROCEDURE [dbo].[Test_WS_Rpt_SubOptCodesSp1] (@item ItemType)
AS
BEGIN
select * from (
values ('a'),('b')
) as X(a)
END
GO
EXEC Test_WS_Rpt_SubOptCodesSp1 @item = 'test'`
The text was updated successfully, but these errors were encountered: