Home Forums SQL Server 2012 SQL 2012 - General SQL Serer 2012 gives error: "Must declare the scalar variable" even when variable is declared RE: SQL Serer 2012 gives error: "Must declare the scalar variable" even when variable is declared
spaghettidba
SSC Guru
Points: 105732
More actions
December 18, 2014 at 2:47 am
#1765369
It looks like you have to add parentheses to your RAISERROR command:
raiserror( @errno,10,1, @errmsg)
At least, in my 2012 and 2014 instances it worked.
-- Gianluca Sartori