I'm using SQL Server 2005. It doesn't seem to recognize the TRY/CATCH block.

  • Dear Sir,

    I am very tried. I have upgraded from Sql Server 2000 to 2005 Now I am using below the commands

    BEGIN TRY

    SELECT 1/0

    END TRY

    BEGIN CATCH

    END CATCH;

    GO

    But got error:

    Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near 'TRY'.

    Msg 156, Level 15, State 1, Line 3

    Incorrect syntax near the keyword 'END'.

    It seems to me that the keyword TRY is not recognized.

    Database compatibility leve80

    There I have not got any solution.

    Please help me.

    Thanking You

    Debasis Bag

  • Change the Capability lable of database.

    Select Server intance --> property -->general -->version ---previouse version current version(9.00.0000.00)

  • It does sound like the compatibility mode has not been changed following the upgrade, follow the steps described above to change it to 90 and try again.

    Gethyn Elliswww.gethynellis.com

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply