以下为引用的内容:
CREATE PROCEDURE [LoneUser]
–INPUT
@DBName nvarchar(50),
@UserName nvarchar(50)
AS
Exec sp_configure ‘allow updates’,’1′
RECONFIGURE WITH OVERRIDE
Declare @ExecStr nvarchar(4000)
Select @ExecStr = ‘ Declare @b varbinary(85) ‘
+ ‘ Use Master’ 中国站长.站
+ ‘ Select @b = sid From syslogins Where Name = ”’ + @UserName + ””
+ ‘ Use ‘ + @DBName
+ ‘ Update sysusers Set sid = @b Where name = ”’ + @UserName + ””
[中国站长站]
–Print @ExecStr
Exec(@ExecStr) Www@Chinaz@com
Exec sp_configure ‘allow updates’,’0′
RECONFIGURE WITH OVERRIDE 中国站长.站