How to Handle the exceptions in Sqlsrver 2005??

Answer Posted / indraneelandhavarapu

With SQL Server 2005, new error handling has been introduced
with the TRY...CATCH processing. Basically what happens is
when an error occurs the processing in the TRY block stops
and processing is then picked up in the CATCH block.

ERROR_NUMBER() Returns the number of the error
ERROR_SEVERITY() Returns the severity
ERROR_STATE() Returns the error state number
ERROR_PROCEDURE() Returns the name of the stored procedure
or trigger where the error occurred
ERROR_LINE() Returns the line number inside the routine
that caused the error
ERROR_MESSAGE() Returns the complete text of the error
message. The text includes the values supplied for any
substitutable parameters, such as lengths, object names, or
times

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does any body please help me what question's have asked for SSRS in the interview?

1873


What is merge replication?

858


How to set database to be single_user in ms sql server?

761


What is the difference between ‘having’ clause and a ‘where’ clause?

768


What is sql server locking?

700






What are sp_configure commands and set commands?

719


How to create a simple table to test triggers in ms sql server?

680


How to convert binary strings into integers in ms sql server?

724


What are the system database in sql server 2008?

731


What is a unique key constraint?

722


How to drop an existing table with "drop table" statements in ms sql server?

725


How to delete database objects with "drop" statements in ms sql server?

770


How many types of dimensions are there and what are they? : sql server analysis services, ssas

774


Mention what are the different types of ssrs reports?

126


Explain what are the database objects? : SQL Server Architecture

753