<p class="intro">sqlserver数据库迁移后,孤立账号解决办法,需要的朋友可以参考下。</p> 代码如下:<br>declare @cmd nvarchar(4000) <br><br>set @cmd = N'exec [?].sys.sp_change_users_login @Action = ''Auto_Fix'' <br>, @UserNamePattern = ''qa'' <br>, @LoginName = null <br>, @Password = ''abc'' ' <br><br>exec sp_msforeachdb @cmd <br><br>