raiserror Questions

9

Solved

Our client side code detects deadlocks, waits for an interval, then retries the request up to 5 times. The retry logic detects the deadlocks based on the error number 1205. My goal is to test both...
Sanitarian asked 19/7, 2012 at 21:59

3

Solved

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

4

Solved

I am trying to show my int variables in raiserror @MaxAmount and @MinAmount Raiserror('Total Amount should be less than %s and Greater than %s',16,1,@MaxAmount,@MinAmount) But Im getting error:...
Fleda asked 16/9, 2015 at 10:3

4

Can you not raise errors within a case statement in T-SQL? I always have problems with SQL case statements :/ begin try declare @i int --set @i = (select COUNT(1) from table_name) select Ite...
Disburden asked 14/5, 2014 at 15:35

4

Solved

In previous versions we raised errors in t-sql like: RAISERROR 50000 'My Error Message' In the latest SQL Server this syntax has been discontinued and replace with the RaiseError () syntax. I w...
Flavorful asked 11/4, 2013 at 8:59

2

Solved

I'm looking through questions for Microsoft's 70-761 exam and I came across a troublesome one. The question asks to 'produce a warning if '. It seems obvious that I should use RAISERROR (or THROW)...
Kweichow asked 31/3, 2018 at 20:25

3

Solved

I generate the raise error in SQL procedure: RAISERROR('Already exist',-10,-10) but I can not catch it using the following code in C# catch (SqlException ex) { bResult = false; if (ex.Errors...
Ahmed asked 2/3, 2014 at 11:13

2

Solved

My best google result was this: below 11 are warnings, not errors 11-16 are available for use above 16 are system errors there is no behavioral difference among 11-16 But, from BOL, "Severity l...
Narceine asked 14/7, 2009 at 0:46

1

Following up from here, I keep getting overflows. So I'm trying to raise an exception so that I know exactly what's going wrong where. I've got something like this: @jit def train_function(X, y,...
Helman asked 13/9, 2014 at 9:4

1

Solved

MSDN states the following syntax: RAISERROR ( { msg_id | msg_str | @local_variable } { ,severity ,state } [ ,argument [ ,...n ] ] ) [ WITH option [ ,...n ] ] The msg_str expects a string up ...
Electrolier asked 24/11, 2016 at 11:18

1

Solved

I am trying to make a bit of code that takes in 2 separate columns, a month and a year. From there I want it to see if those numbers entered have already passed or not. If they have passed, cause a...
Trudytrue asked 25/1, 2015 at 18:52

1

Solved

I have a stored procedure in my SQL Server 2008 database and I am devloping a java application that use a sqljdbc4 connection. Everything works fine, even procedure call, but there is one thing - i...
Harakiri asked 20/10, 2012 at 14:17

2

Solved

I have some 3-4 stored procedures ― which I can modify if needed ― that use RAISERROR to inform my application of some fatal errors on the database side. Some of these stored procedures are execute...
Bivins asked 28/6, 2011 at 15:44

1

Solved

I have a lengthy stored procedure in which I would like to do something like the following: IF @SubPageDirectory IS NULL BEGIN RAISERROR('@SubPageDirectory cannot be NULL', 10, 1) EXIT STORED PR...
Mescal asked 15/7, 2010 at 13:56

3

Solved

Having a small issue and wondering if I'm using these correctly. In my SQL script is have BEGIN TRY // check some information and if there are certains errors RAISERROR ('Errors found, please f...
Dialyse asked 15/7, 2009 at 13:28

14

Solved

I'd like know what people think about using RAISERROR in stored procedures to pass back user messages (i.e. business related messages, not error messages) to the application. Some of the senior d...
Topside asked 17/9, 2008 at 22:12

2

Solved

I am interacting with SQL Server 2005 from a jsp via JDBC (this is an assignment not a real project) and I have created a trigger in the database I am using. If a certain condition is not met when ...
Cid asked 1/6, 2009 at 4:54
1

© 2022 - 2024 — McMap. All rights reserved.