Beskrivelse
Siden SQL Server 2005 kan du bruge fejlhåndtering ved at bruge TRY
CATCH
Eksempel
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