Hello I have a stored procedure that looks similar to this:
CREATE Proc [dbo].[MyStoredProc]
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
GO
CREATE Proc [dbo].[MyStoredProc];2
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
GO
When I run the comparison using SQL Compare between my Development and Production DB (the Production DB does not have the stored Proc). I see the difference as shown above. But when I run the Synchronization Wizard I get the following error when I use the “Synchronize databases now†option.
The following error message was returned from the SQL Server:
[102] Incorrect syntax near 'GO'.
The variable name '@start' has already been declared. Variable names must be unique within a query batch or stored procedure.
The following SQL command caused the error:
CREATE Proc [dbo].[MyStoredProc]
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
GO
CREATE Proc [dbo].[MyStoredProc];2
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
However, when I use the “Launch the script in SQL Server Management Studio†option and run the generated script without modification, it works fine.
This is a problem when I try to automate the comparison with the SQL Compare API. Could you suggest a workaround that will help me resolve this issue?
Thanks
Steve
CREATE Proc [dbo].[MyStoredProc]
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
GO
CREATE Proc [dbo].[MyStoredProc];2
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
GO
When I run the comparison using SQL Compare between my Development and Production DB (the Production DB does not have the stored Proc). I see the difference as shown above. But when I run the Synchronization Wizard I get the following error when I use the “Synchronize databases now†option.
The following error message was returned from the SQL Server:
[102] Incorrect syntax near 'GO'.
The variable name '@start' has already been declared. Variable names must be unique within a query batch or stored procedure.
The following SQL command caused the error:
CREATE Proc [dbo].[MyStoredProc]
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
GO
CREATE Proc [dbo].[MyStoredProc];2
As
Declare @start datetime, @end datetime;
/*
stored procedure Text
*/
However, when I use the “Launch the script in SQL Server Management Studio†option and run the generated script without modification, it works fine.
This is a problem when I try to automate the comparison with the SQL Compare API. Could you suggest a workaround that will help me resolve this issue?
Thanks
Steve