Top "Raiserror" questions

What do the different RAISERROR severity levels mean?

My best google result was this: below 11 are warnings, not errors 11-16 are available for use above 16 are system errors …

sql-server raiserror
Catch SQL raise error in C#

I generate the raise error in SQL procedure: RAISERROR('Already exist',-10,-10) but I can not catch it using …

c# sql-server raiserror
Raise custom error message with RAISERROR in SQL Server

In previous versions we raised errors in t-sql like: RAISERROR 50000 'My Error Message' In the latest SQL Server this syntax …

sql-server tsql raiserror
TRY and RAISERROR in T-SQL

Having a small issue and wondering if I'm using these correctly. In my SQL script is have BEGIN TRY // check …

tsql error-handling raiserror
How to simulate a deadlock in SQL Server in a single process?

Our client side code detects deadlocks, waits for an interval, then retries the request up to 5 times. The retry logic …

sql sql-server unit-testing deadlock raiserror
How to print DateTime variable in the RAISERROR method?

My Stored Procedure accepts two params @EffectiveStartDate DATETIME @EffectiveEndDate DATETIME I wrote the validation code as this: IF(@EffectiveStartDate > @…

sql sql-server sql-server-2005 stored-procedures raiserror
Trigger with a RAISERROR and ELSE case issue

I am trying to make a bit of code that takes in 2 separate columns, a month and a year. From …

sql-server triggers datediff raiserror
T-SQL - Return custom error message and end query

I have a lengthy stored procedure in which I would like to do something like the following: IF @SubPageDirectory IS …

sql-server-2005 tsql asp.net-3.5 raiserror
How to use variables in SQL raiserror

I am trying to show my int variables in raiserror @MaxAmount and @MinAmount Raiserror('Total Amount should be less than %…

sql sql-server raiserror
How to set SQLException Number

I'm having an issue on settin up SqlException.Number On my Stored Proc i'm raising an error --@number = 50001 RAISERROR(@…

sql-server sqlexception raiserror