Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Mapping a Login to a Database at the Instance level Expand / Collapse
Author
Message
Posted Tuesday, July 9, 2013 4:05 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 3:41 PM
Points: 121, Visits: 1,400
Friends,

I am trying to map a Login to one of the Databases in the Server Instance. However, I am unable to do so through SSMS.

I have login xxxxxxxx at the Instance Level. I am trying to map this Login to one of the DBs in this Instance. I going to the properties page of the login through Security folder and going to the User Mapping options. I am clicking the check box of the DB that i want say A and clicking on the OK button. The window shows as if it is executing. However, when I check the properties again, this DB remains unchecked.

Is there a script using which we can map a DB to a Login at the Instance level.

thanks
Murali
Post #1471519
Posted Tuesday, July 9, 2013 4:50 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 3:41 PM
Points: 121, Visits: 1,400
I got the issue resolved by deleting the User from the Database and mapping the login to the DB after that..
Post #1471534
Posted Tuesday, July 9, 2013 5:13 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:55 AM
Points: 6,752, Visits: 14,397
MuraliKrishnan1980 (7/9/2013)
I got the issue resolved by deleting the User from the Database and mapping the login to the DB after that..

for future reference there's no need to delete the user. Use either

USE [yourdb]
GO
exec sp_change_users_login 'UPDATE_ONE', 'dbusername', 'loginname'

Or

USE [yourdb]
GO
ALTER USER dbuserName WITH LOGIN = loginName



-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #1471543
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse