it can be found from sys.database_principals or sysusers table.
one example to build SQL by using it.
select 'sp_change_users_login ''auto_fix'','+name+',null,null' from sys.database_principals where type='S' and default_schema_name not in ('dbo','guest') and default_schema_name is not null
No comments:
Post a Comment