How to use Try catch in sql server and print the error messageKarthikeyan Anbarasan15yPublished Mar 29, 2011, 12:00 AMUpdated Mar 30, 2011, 1:26 AM4.1k00Reactions×25BlogBEGIN TRY DELETE FROM tablesamaple where strsampletodelete = 'todelete' END TRYBEGIN CATCHPrint ERROR_MESSAGE()END CATCHCommentsJoin the conversation! Your thoughts help the community grow.Sign in to leave a commentIt is the same account you read, post and publish with — and you will come straight back to this page.Sign inCreate an account
Join the conversation! Your thoughts help the community grow.