直播中
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)
Exec sp_configure 'allow updates','0'
RECONFIGURE WITH OVERRIDE