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

  • 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