Solved

do users go with you

Posted on 2004-04-14
8
334 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

685 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