Beskrivning
Sedan SQL Server 2005 kan du använda felhantering med TRY
CATCH
Exempel
BEGIN TRY
BEGIN TRANSACTION
-- do something
COMMIT TRAN -- Transaction successfull, commit!
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRAN --RollBack if error occured
END CATCH