TRY-CATCH Block-SQL Server
In SQL server 2000, to handle sql server exception we have to use goto statement while in the sql server 2005 support the try-catch type of exception handling just like vb.net or c#.here is exmple of it. set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgoCREATE PROCEDURE [dbo].[sp_InsertState]@StateId int,@Name varchar(30)ASBEGIN declare @Error Int declare @TableName sysname declare @ErrorMessage nvarchar(2000)