RaiseError Command in T-SQL

1k Views Asked by At

So I was trying to put in a RaisError statement earlier today, and accidentally put it in as follows:

RaiseError ('Some error message', 16, -1)

Note the extra e.

Naturally, it threw an error, as it was meant to be RaisError, but what caught me off guard was the fact that in SSMS 2012, RaiseError was syntax-highlighted pink, as if it was a system function. So when I was writing it, I didn't notice I added an extra e until I tried to run it.

That got me wondering what RaiseError was used for. I hit up MSDN and Google trying to find some information or documentation about RaiseError, but I could not find anything that even hinted at its existence. Everything I found referred to RaisError.

What purpose does RaiseError serve, and how is it used? Is this even a thing? Are my Google skills failing me, or is this just a bug in SSMS making an already confusing naming convention more confusing?

1

There are 1 best solutions below

3
On

RaiseError was depreciated in SQL 2008, and no longer in 2012. RaiseError was the old format of RaisError without a "()"

The Following article here mentions below: Microsoft Article

Transact-SQL The RAISERROR (Format: RAISERROR integer string) syntax is deprecated. Rewrite the statement using the current RAISERROR syntax. Oldstyle RAISEERROR 164