SA0229 : This syntax of RAISERROR is discontinued. Rewrite the statement using the current RAISERROR(…) syntax or consider using THROW |
The topic describes the SA0229 analysis rule.
This syntax of RAISERROR is discontinued. Rewrite the statement using the current RAISERROR(…) syntax or consider using THROW
The rule checks T-SQL code for usages of the deprecated RAISERROR syntax.
RAISERROR in the format RAISERROR integer ‘string’ is deprecated in SQL Server 2012 and discontinued in SQL Server 2014.
Rewrite the statement using the current RAISERROR(…) syntax or consider using THROW statement.
The rule has a Batch scope and is applied only on the SQL script.
Rule has no parameters.
The rule does not need Analysis Context or SQL Connection.
Deprecated Features, Bugs
SQL
1declare @errno int 2declare @errmsg varchar(500) 3select @errno=@@error 4 5if @errno<>0 6begin 7 select @errmsg='Error: '+ convert(varchar(10),@errno) 8 9 raiserror 200016 @errmsg 10 11 raiserror(@errmsg,200016,1) 12 13 return 1 14end |
Message | Line | Column | |
---|---|---|---|
1 | SA0229 : This syntax of RAISERROR is discontinued. Rewrite the statement using the current RAISERROR(…) syntax or consider using THROW. | 9 | 4 |