IF @SQL IS NOT NULL BEGIN BEGIN TRY EXEC sp_executesql @SQL PRINT \'SUCCESS: \' + @SQL END TRY BEGIN CATCH SET @ErrorMessage =
From MSDN:
The statement before the THROW statement must be followed by the semicolon (;) statement terminator.