Statistics

Total Posts: 34
This Year: 0
This Month: 0
This Week: 0
Comments: 174


RSS 2.0   SocialTwist Tell-a-Friend


Admin

Sign In

Navigation


Recent Posts


On this page....

SQL Server Permissions - Fixing Orphaned Users

Archives

 Full Archives By Category
 2007 Calendar View
<December 2008>
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Categories

CDOSYS (1) Classic ASP (10) Command Line (2) Databases (16) Excel (1) HTML (1) IIS (10) Indexing Service (1) Internet Explorer (7) Media Streaming (1) MS.Net (2) SQA (7) SQL Server (16) Windows OS (2)

Blogroll - Fav Blogs


Acknowledgments

DasBlog Theme Design by: Tom Watts
E-mail: Send mail to the author(s)
Theme Image by: dreamLogic

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Technology Blog

# Wednesday, December 10, 2008
Author: Akash Heranjal

Problem:

The database backup is taken from the development environment and the BAK file is restored on the production server. On restoring the database from the BAK file, the database users with DB Owner rights are also restored along with the database. But checking the security >> user list in SQL server does not display these users. The SQL server does not allow deleting the users from the database manually as they own objects in the DB. SQL Server does not allow creating the DB user and assign DB Owner rights for the user to the restored DB.

Cannot delete the user as it own objects in the database.


Solution:

The database users as explained in the problem above are called “Orphaned Users”. Run the following query in “Masters” DB to sync the Orphaned User.

sp_change_users_login 'auto_fix', 'User Name'

User Name here is the name of the orphaned database user.