1、@@ERROR 
返与@@ERROR 近语句错误码局限于DML语句select语句执行现错误则返等于0错误码没错则返0通使用判断语句没执行功
-- Create Schema if not one exists with same name and owner
    set @stmtS = 'create schema '
    set @stmtS = @stmtS + quotename(@rolename, ']')
    set @stmtS = @stmtS + ' authorization '
    set @stmtS = @stmtS + quotename(@rolename, ']')
    
    BEGIN TRANSACTION

    -- issue DDL to create the role --
    exec (@stmtR)    
    if @@error <> 0
    begin
        ROLLBACK TRANSACTION
        return (1)
    end

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-11-17
  • 2021-08-08
  • 2021-05-18
相关资源
相似解决方案