Solved

RAISEERROR In SQL Server Stored Procedures

Posted on 2013-06-23
1
401 Views
Last Modified: 2013-07-01
If I raise an Error as

RAISERROR 500001 ' Status change failed: There are already at least 1 server out of rotation'        
 RETURN      


If this raiserror is executed within a stored procedure will this automatically fail the procedure


Thanks In Advance
0
Comment
Question by:VitaminD
1 Comment
 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 500 total points
ID: 39269958
use SET XACT_ABORT ON to make sure the transaction is stopped and rolled back in the event of a RAISERROR...More info

http://msdn.microsoft.com/en-us/library/ms188792.aspx

Hope this helps.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Temporarily disable SQL Replication 7 23
Need Counts 11 43
SQL Server RDS clr assembly 4 37
Copy Database Wizard Error 3 22
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now