views:

46

answers:

1

Hi, this T-SQL script works fine in SQL Server 2005 but in SQL Server 2000 it says incorrect Syntax near 'Try' 'End'. Any help please?

Begin Transaction 
Begin Try 
  UPDATE Test 
  SET RefID = 'bc27de13-2323-4ce8-8c87-0171efbd812a' 
  WHERE RefID = 'bc27de13-2323-4ce8-8c87-0171ffbd812a'; 

  DELETE FROM Physician 
  WHERE RefID = 'bc27de13-2323-4ce8-8c87-0171ffbd812a' 

  Commit Transaction 
End Try 
Begin Catch 
  Rollback Transaction 
End Catch
+3  A: 

As Sikender said in his comment, this post asks almost exactly the same question, and the answer here is the same. SQL Server 2000 doesn't suport try..catch; that was added in SQL Server 2005. So no matter what you try, it will never work in SQL Server 2000.

Ken White