When I backup a database to a single file in SQL2K, then restore that
database onto another machine, I lose users I have created (and I understand
that is expected behavior). Then I manually remove the name of the user
under "Name" since it doesn't have a "Login Name" and then just add this
same user as a New user and both the Name and Login Name appear and
everything is fine.
Is there a way to script this using SQL so if someone unfamiliar with EM
could simply run a script?This happens only with SQL Server authentication, not with Windows
authentication. So the first recommendation to avoid this problem is to use
Windows authentication.
In both cases, the login must exist on the new server.
For SQL Server authentication only use the sp_change_users_login to update
the link between logins and users of a database. For example,
sp_change_users_login 'auto_fix', myuser
Hope this helps,
Ben Nevarez, MCDBA, OCP
Database Administrator
"Don Miller" wrote:
> When I backup a database to a single file in SQL2K, then restore that
> database onto another machine, I lose users I have created (and I understa
nd
> that is expected behavior). Then I manually remove the name of the user
> under "Name" since it doesn't have a "Login Name" and then just add this
> same user as a New user and both the Name and Login Name appear and
> everything is fine.
> Is there a way to script this using SQL so if someone unfamiliar with EM
> could simply run a script?
>
>|||Hope this helps!
http://support.microsoft.com/kb/246133/|||Thanks.
"Don Miller" <nospam@.nospam.com> wrote in message
news:e5$tB1scGHA.3888@.TK2MSFTNGP02.phx.gbl...
> When I backup a database to a single file in SQL2K, then restore that
> database onto another machine, I lose users I have created (and I
understand
> that is expected behavior). Then I manually remove the name of the user
> under "Name" since it doesn't have a "Login Name" and then just add this
> same user as a New user and both the Name and Login Name appear and
> everything is fine.
> Is there a way to script this using SQL so if someone unfamiliar with EM
> could simply run a script?
>
No comments:
Post a Comment