IF @SQL IS NOT NULL BEGIN BEGIN TRY EXEC sp_executesql @SQL PRINT \'SUCCESS: \' + @SQL END TRY BEGIN CATCH SET @ErrorMessage =
From the Documentation on THROW, Remarks:
The statement before the THROW statement must be followed by the semicolon (;) statement terminator.
It's a good habit to always end your statements with a semi-colon.