Reputation: 20045
I generated a SQL script from SQL Server 2000 because I can't just use the .bak
file to restore into version 2014. When I tried to execute the generated SQL script on the new SQL Server 2014, I get an error
Incorrect syntax near the keyword 'SET'
Checking the blamed line:
IF ISNULL(@pi_strMChargeNo,'') = '' BEGIN
INSERT INTO TPURCHASEGROUP(MCHARGENO, CASHPRICE, COUPONPRICE, EVENTPRICE, TOTALPRICE, PITEMCNT, REGDATE, UPDDATE)
VALUES(@v_strMChargeNo, 0, 0, 0, 0, 1, GETDATE(), GETDATE())
IF @@ERROR <> 0
BEGIN
SET @po_strErrMsg = 'TPURCHASEGROUP INSERT FAIL'
SET @po_intRetVal = 2266
SET RETURN -- blamed
END
END
Might be changes to the syntax from 2000 to 2014, but what? Or possibly just delete the line?
Upvotes: 0
Views: 427
Reputation: 109077
Without further context, it looks like you should replace the line SET RETURN
by RETURN
.
Regarding your problem with restoring a backup. You might want to try restoring on SQL Server 2008, increase the compatibility level of the database to 100
, make a new backup and restore that under SQL Server 2014.
Upvotes: 4