新闻分类
推荐新闻
当前位置:首页 > 新闻中心 > 解决方案 > 查看新闻
错误2812:未能找到存储过程'sp_password'
作者:tlwcrj  来源:本站  发表时间:2012-9-3 19:15:27  点击:1171

错误2812:未能找到存储过程'sp_password'

在查询分析器执行以下代码:

create procedure sp_password
    @old sysname = NULL,        -- the old (current) password
    @new sysname,               -- the new password
    @loginame sysname = NULL    -- user to change password on
as
    -- SETUP RUNTIME OPTIONS / DECLARE VARIABLES --
 set nocount on
    declare @self int
    select @self = CASE WHEN @loginame is null THEN 1 ELSE 2 END

    -- RESOLVE LOGIN NAME
    if @loginame is null
        select @loginame = suser_sname()

    -- CHECK PERMISSIONS (SecurityAdmin per Richard Waymire) --
 IF (not is_srvrolemember('securityadmin') = 1)
        AND not @self = 1
 begin
    dbcc auditevent (107, @self, 0, @loginame, NULL, NULL, NULL)
    raiserror(15210,-1,-1)
    return (1)
 end
 ELSE
 begin
    dbcc auditevent (107, @self, 1, @loginame, NULL, NULL, NULL)
 end

    -- DISALLOW USER TRANSACTION --
 set implicit_transactions off
 IF (@@trancount > 0)
 begin
  raiserror(15002,-1,-1,'sp_password')
  return (1)
 end

    -- RESOLVE LOGIN NAME (disallows nt names)
    if not exists (select * from master.dbo.syslogins where
                    loginname = @loginame and isntname = 0)
 begin
  raiserror(15007,-1,-1,@loginame)
  return (1)
 end

 -- IF non-SYSADMIN ATTEMPTING CHANGE TO SYSADMIN, REQUIRE PASSWORD (218078) --
 if (@self <> 1 AND is_srvrolemember('sysadmin') = 0 AND exists
   (SELECT * FROM master.dbo.syslogins WHERE loginname = @loginame and isntname = 0
    AND sysadmin = 1) )
  SELECT @self = 1

    -- CHECK OLD PASSWORD IF NEEDED --
    if (@self = 1 or @old is not null)
        if not exists (select * from master.dbo.sysxlogins
                        where srvid IS NULL and
            name = @loginame and
                     ( (@old is null and password is null) or
                              (pwdcompare(@old, password, (CASE WHEN xstatus&2048 = 2048 THEN 1 ELSE 0 END)) = 1) )   )
        begin
      raiserror(15211,-1,-1)
      return (1)
     end

    -- CHANGE THE PASSWORD --
    update master.dbo.sysxlogins
 set password = convert(varbinary(256), pwdencrypt(@new)), xdate2 = getdate(), xstatus = xstatus & (~2048)
 where name = @loginame and srvid IS NULL

 -- UPDATE PROTECTION TIMESTAMP FOR MASTER DB, TO INDICATE SYSLOGINS CHANGE --
 exec('use master grant all to null')

    -- FINALIZATION: RETURN SUCCESS/FAILURE --
 if @@error <> 0
        return (1)
    raiserror(15478,-1,-1)
 return  (0) -- sp_password

 

 

下条新闻:管家婆会员版
版权所有:铜陵微尘软件销售服务中心;地址:铜陵大市场天山公寓404室(消防支队对面) 咨询/售后电话:0562-2602996;手机:15385625806;QQ:541950352 铜陵微尘软件


管好生意,轻松赚钱!家庭要有好老婆,企业要用管家婆!

本站关键词:铜陵管家婆 | 梦网SEO:
黄焖鸡米饭
华佗面膜官网
钛酸锂
石材马赛克
内蒙古400电话
源码交易
重庆长城宽带
安米娜
无线隐形耳机
佛山房贷
铜陵管家婆
lol代练
马鞍山
水泥围栏设备
名创优品货架
东莞画册印刷
贴针灸
代做银行流水
砂石分离机
奶茶培训
广州快速贷款
长沙车辆抵押贷款
防汛沙袋
复合井盖
通风降温

访问量:5504662   皖ICP备14018703号