Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incorrect Syntax near the keyword 'OR' in CREATE OR ALTER PROCEDURE

I have a master script that runs and create all stored procedures, but when I run the script I error out at the only two places that use the syntax CREATE OR ALTER PROCEDURE

The code is below:

CREATE OR ALTER PROCEDURE [dbo].[P_ReinitializeStorePlans]
    @storeId INT
AS
BEGIN    
    RETURN;
END
GO

And the error is as follows, I have another CREATE OR ALTER PROCEDURE later at line 2713 as well with the same error.

SQL Error for CREATE OR ALTER PROCEDURE

I have checked my @@VERSION which returns SQL 2016 as well as 130 for the compatibility version. Any idea why this is giving me an error? I am assuming its a compatibility setting or flag for the syntax?

SQL Compatibility Versions for Databases

like image 466
Benny Avatar asked Mar 05 '23 19:03

Benny


1 Answers

I believe this one comes with SP1 installed, this has a version of

13.0.4001.0 KB3182545

https://support.microsoft.com/en-us/help/3177312/sql-server-2016-build-versions

I suggest you go straight to SP2 you can get it from here https://go.microsoft.com/fwlink/?linkid=869608

like image 169
Mihail Shishkov Avatar answered Mar 09 '23 00:03

Mihail Shishkov