Friday, August 30, 2013

BEGIN AND END INSIDE TRY BLOCK

First of all you can implement this without the BEGIN TRY\ END TRY blocks.. I dont get what is meant by (CHECK IF VALUES EXISTS) ?


IF EXISTS , should have some subquery to test..otherwise EXISTS the following code block works



DECLARE @C INT=10
BEGIN TRY
IF @C='FF'
BEGIN
PRINT 'RIGHT'
END

END TRY
BEGIN CATCH
PRINT 'VALUE IS DIFFERENT'
END CATCH





Thanks, hsbal


No comments:

Post a Comment