Friday, February 24, 2012

Copy users between databases

Hello All,
I used DTS to copy one database to a blank database for a backup of the
database. A duplicate database.
How do I copy over the user logins to the new database.
This did not happen with DTS.
The databases are on the same instance of SQL.
Any help appreciated.
Thanks,
Terry
tgwillett@.cox.netRun this on the database to autofix users
select 'exec sp_change_users_login ''Auto_Fix'', ''' + name + '''' from
sysusers
where name not in ('INFORMATION_SCHEMA', 'dbo', 'guest', 'public')
"Terry" wrote:

> Hello All,
> I used DTS to copy one database to a blank database for a backup of the
> database. A duplicate database.
> How do I copy over the user logins to the new database.
> This did not happen with DTS.
> The databases are on the same instance of SQL.
> Any help appreciated.
> Thanks,
> Terry
> tgwillett@.cox.net
>
>

No comments:

Post a Comment