How to use Try catch in sql server and print the error message

BEGIN TRY
 
DELETE FROM tablesamaple where strsampletodelete = 'todelete'
 
END TRY
BEGIN CATCH
Print ERROR_MESSAGE()
END CATCH
Ebook Download
View all
Learn
View all