Solved

do users go with you

Posted on 2004-04-14
8
333 Views
Last Modified: 2006-11-17
When you do a restore of 10 databases from a location to a new location , will the user ids and logins go with you.  How do you transfer all of the ids and logins?

0
Comment
Question by:gupshup
  • 4
  • 2
  • 2
8 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 10826872
The users go with the database.  However, the logins don't.  The logins are stored in the master database.  You can use sp_change_users_login to relink the login with the user.
0
 

Author Comment

by:gupshup
ID: 10826913
do you recommend me bringing over the master database?
0
 
LVL 8

Expert Comment

by:plq
ID: 10826923
1. Ensure that the logins exist in the new database
2. Connect to the new database
3. Run
exec sp_revokedbaccess 'username'
4. Run
exec sp_grantdbaccess 'username'


repeat steps 3 and 4 for every user
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 8

Expert Comment

by:plq
ID: 10826931
No don't bring over the master db, script the logins using generate sql scripts
0
 

Author Comment

by:gupshup
ID: 10826948
abert,

i can still run the sp that you recommended however the old server is gone.....it has crashed......so im assuming running the sp wont help...correct?
0
 
LVL 34

Accepted Solution

by:
arbert earned 20 total points
ID: 10827106
IT will help.  You have the users in the database and all the permissions are set for this user.  The stored proc will relink the user with a login.
0
 
LVL 34

Expert Comment

by:arbert
ID: 10827110
Search in Books Online for sp_change_users_login
0
 
LVL 34

Expert Comment

by:arbert
ID: 10827144
Gupshup, like I've suggested to you several times in the past--get a good book (http://www.amazon.com/exec/obidos/tg/detail/-/0130614300/qid=1081972369/sr=8-5/ref=pd_ka_5/002-1884116-6048004?v=glance&s=books&n=507846).

You're asking some very simple questions that you could save yourself a LOT of time and money on with a book....
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question