Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Users lost when restoring database

Status
Not open for further replies.

apollo11

Programmer
Apr 5, 2001
35
0
0
US
When I restore my SQL 7.0 database backup I do not see the users that I originally had in the database. What's strange is , if I create those users afresh and try to add them Enterprise manager throws an error saying that the user already exists. Is there a way to remove a user from any of the systables? so that I can add them again?
 
I've never seen users fail to restore properly unless the backup come from a differenct server or the master database was recreated since the backup was made. You can usually use sp_change_users_login to synch database users and server logins. See SQL BOL or the following online link.


If this doesn't help, you can set ad hoc system table updates On and delete rows from the sysusers table in the database. Use this option very carefully. You may make the DB inaccessible. Be sure to set the ad hoc update option off when finished. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions in the SQL Server forum. Many of the ideas apply to all forums.
 
Hi There

To Delete the Users and the Logins from the Server
Try the following script


-- ALLOW MODIFICATIONS TO THE SYSTEM DATABASES

sp_configure 'allow updates', 0
RECONFIGURE WITH OVERRIDE
GO


-- DELETE THE LOGINS FROM THE MASTER DATABASE

Use Master
delete from syslogins
where name = '<Login Name>'
GO


--DELETE THE USERS FROM THE USER DATABASE

Use <USER DATABASE NAME>
GO
Delete from sysusers
where name = '<User Name>'
GO


-- DISALLOW MODIFICATIONS TO THE SYSTEM DATABASES

sp_configure 'allow updates', 0
RECONFIGURE WITH OVERRIDE


Hope This Helps Bernadette
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top