Every database contains a table called sysusers, which stores a list of all
users who have access to that database. You can use following stored
procedures to get detailed info and put same users on different databases.
sp_change_users_login : Use this stored procedure to see and fix orphaned
users.
sp_validatelogins : This stored procedure reports information about orphaned
Microsoft Windows NT/2000 users and groups that no longer exist in the
Windows NT environment but still have entries in the Microsoft SQL Server
system tables.
Detail on following links:
http://vyaskn.tripod.com/troubleshooting_orphan_users.htm
http://support.microsoft.com/default.aspx?scid=kb;en-us;246133
Hope this helps.
Awais Bin Khalid
Microsoft Certifiec Application Developer
www.xavor.com
> Hi
> There are two stored procedures provided by Microsoft to transfer
[quoted text clipped - 26 lines]
> login
> > on SQL1. Can this be done?
Vern Rabe - 26 Jul 2005 19:11 GMT
According to BOL, sp_change_users_password only works with SQL Server
Authentication, not Windows Authentication. I ran into the same problem and
came up with this script, which I run on the destination server immediately
after the restore:
exec sp_configure 'allow updates', 1
go
RECONFIGURE WITH OVERRIDE
go
update sysusers
set sid = l.sid
from dbo.sysusers u
join master.dbo.syslogins l
on 'Win2\' + u.name = l.name
exec sp_configure 'allow updates', 0
go
RECONFIGURE WITH OVERRIDE
go
HTH
Vern Rabe
> Every database contains a table called sysusers, which stores a list of all
> users who have access to that database. You can use following stored
[quoted text clipped - 48 lines]
> > login
> > > on SQL1. Can this be done?