数据库迁移后,孤立账号解决办法
declare @cmd nvarchar(4000)
set @cmd = N'exec [?].sys.sp_change_users_login @Action = ''Auto_Fix''
, @UserNamePattern = ''qa''
, @LoginName = null
, @Password = ''abc'' '
exec sp_msforeachdb @cmd
数据库迁移后,孤立账号解决办法
declare @cmd nvarchar(4000)
set @cmd = N'exec [?].sys.sp_change_users_login @Action = ''Auto_Fix''
, @UserNamePattern = ''qa''
, @LoginName = null
, @Password = ''abc'' '
exec sp_msforeachdb @cmd