首頁 關于我們 新聞資訊 產品與服務 產品優勢 解決方案 客戶案例 常見問題 聯系我們
解決方案導航: 假日酒店的財務軟件解決方案
常見問題 MORE..
常見問題
聯系我們

銷售部電話:0315-2691200 13931465546 13148001000 13393050922
技術部電話:15532553859 15532556392 15532556013
客服部電話:0315-5773765
公司QQ:55650782
公司網址:www.340754.tw

解決方案 MORE..
假日酒店的財務軟件解決方案
常見問題 首頁 - > 常見問題
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

電話:+86-0315-7849305 傳真:+86-0315-5773765 技術支持 唐山網站建設
郵箱:55650782@qq.com 銷售部電話:0315-2691200/13931465546/13393050922
技術部電話:0315-7849305 客服部電話:0315-5773765/7849296 公司QQ:55650782 地址:河北省唐山市路北區建設路紫金廣場2-1-1702

(^ω^)MG正中红心官网 江苏11选五中奖规则 幸运农场玩法说明 金沙电子棋牌 贵州的麻将怎么打 陕西yy麻将苹果版本 2019算平码技巧 棋牌下载app送28金币 哈灵麻将官方网 千炮捕鱼能赚钱么 广东快乐10分开奖每天开到几点 陕西11选5任选基本走势图玩法 30选5今天基夲走势图 买体育彩票用什么软件 南宁友友麻将下载 广东风采36选7走势图 pc蛋蛋金蛋