概述USE [test] GO /****** Object: StoredProcedure [PROJECT].[autofix_user] Script Date: 12/06/2012 15:25:55 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ================================ USE [test] GO /****** Object: StoredProcedure [PROJECT].[autofix_user] Script Date: 12/06/2012 15:25:55 ******/ SET ANSI_NulLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <zhaorb> -- Create date: <Create Date,> -- Description: <Description,> -- ============================================= ALTER PROCEDURE [PROJECT].[autofix_user] AS DECLARE @cur1 CURSOR DECLARE @name varchar(64) DECLARE @sID varchar(64) SET @cur1=CURSOR FOR select Username = name,UserSID = sID from sysusers where issqluser = 1 and (sID is not null and sID <> 0x0) and (len(sID) <= 16) and suser_sname(sID) is null order by name OPEN @cur1 FETCH NEXT FROM @cur1 INTO @name,@sID WHILE(@@FETCH_STATUS=0) BEGIN EXEC sp_change_users_login 'auto_FIX',@name print 'fixed'+@name FETCH NEXT FROM @cur1 INTO @name,@sID END CLOSE @cur1 DEALLOCATE @cur1 总结
以上是内存溢出为你收集整理的sqlserver数据库恢复后修复用户的过程全部内容,希望文章能够帮你解决sqlserver数据库恢复后修复用户的过程所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
评论列表(0条)