Syntax error when adding custom Acu4GL stored procedure in SQL Server 2012

0 Likes

Problem:

 The application makes use of filename_start stored procedures in SQL Server. When setting up the application on SQL Server 2012 there is an error when trying to add the stored procedure.  The SQL Server Management Studio shows an error like this:

     Msg 102, Level 15, State 1, Procedure filename_start001, Line 20

     Incorrect syntax near '523409'.

The script to install the stored procedure is using the format seen in the Acu4GL documentation and which has been used successfully in earlier versions of SQL Server:

     raiserror 523409 "Record not found"

 Resolution:

 SQL Server 2008 and prior versions supported the short form of raiserror, such as:

     raiserror 523409 "Record not found"

However, SQL Server 2012 no longer supports that.  The stored procedure code must be modified to include the complete raiserror format:

     raiserror (523409,16,1, "Record not found")

Comment List
Anonymous
Related Discussions
Recommended