Thursday, March 8, 2012

Creating a login after the backup was restored with existent users

Is there a way to create the login id after the database backup with users
was restored into this new SQL Server. The problem is that I am trying to
create the login id for the user that owns practically all the database
objects.
So I can't drop that user to execute sp_grantdbaccess after creating the
login id.
thanks
--
Cathy BIf you already created the login on the server and this is a SQL Server
user, then you need to go into each of the database and run:
EXEC sp_change_user_login 'REPORT.
Any users that show up in this list need to be have the following command
executed for them:
EXEC sp_change_users_login 'AUTO_FIX','user'
If you haven't added the logins to the new server yet (which is
preferrable), you run sp_help_revlogin on the old server. You then run the
resulting scrip on the new server to create the logins. You run this AFTER
the restores.
"Cathy Boehm" <CathyBoehm@.discussions.microsoft.com> wrote in message
news:EF2EFDC8-328C-410A-908E-FAA0E49B9220@.microsoft.com...
> Is there a way to create the login id after the database backup with users
> was restored into this new SQL Server. The problem is that I am trying to
> create the login id for the user that owns practically all the database
> objects.
> So I can't drop that user to execute sp_grantdbaccess after creating the
> login id.
> thanks
> --
> Cathy B

No comments:

Post a Comment