T-SQL Throw Exception

This continues to occur in SQL Server 2014.

I have found that putting the semi-colon at the end of BEGIN helps.

This approach has the error

IF 'A'='A'
BEGIN
   THROW 51000, 'ERROR', 1;
END;

And this approach does not have the error

IF 'A'='A'
BEGIN;
  THROW 51000, 'ERROR', 1;
END;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)