Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Try/catch help

$
0
0
I am running SQL SERVER 2005 --- I want to run a try catch statement to do this
BEGIN TRY
--If this statement does not execute succesfully I want to go to the catch
SQL STATEMENT 1
END TRY
BEGIN CATCH
SQL STATEMENT 2
END CATCH

Either statement 1 or statement 2 will be valid, but when I try that code, it only evaluates my Statement1 and then throws the INVALID COLUMN NAME message as opposed to jumping to the CATCH statement. Can someone explain why?

Viewing all articles
Browse latest Browse all 13329

Trending Articles