Incorrect syntax near 'THROW'

前端 未结 3 793
一生所求
一生所求 2020-12-17 07:56
IF @SQL IS NOT NULL
BEGIN
    BEGIN TRY 
        EXEC sp_executesql @SQL
        PRINT \'SUCCESS: \' + @SQL
    END TRY 
    BEGIN CATCH
        SET @ErrorMessage =          


        
3条回答
  •  误落风尘
    2020-12-17 08:39

    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.

提交回复
热议问题