I'm trying to add a TRY/CATCH ROUTINE TO SQL Server 2005 Stored Procedure with no luck. I have now gone back to the very basics, and copied code right from MSDN's examples.
The code below produces the following error -
Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near 'TRY'.
Msg 156, Level 15, State 1, Line 10
Incorrect syntax near the keyword 'END'.
Msg 195, Level 15, State 10, Line 13
'ERROR_NUMBER' is not a recognized function name.
Any ideas? I've tried a couple of MSDN samples, but they all produce syntax errors.
SELECT * FROM SDE.ZIP;
ERROR_NUMBER() AS ErrorNumber,
ERROR_MESSAGE() AS ErrorMessage;