Solved

default setting for  login to access database

Posted on 2010-09-17
4
435 Views
Last Modified: 2012-08-14
when i try the below:

CREATE LOGIN test WITH PASSWORD='test', CHECK_POLICY = OFF
execute as login = 'test'
use ROSE_IT --works ok
use tracker -- says "The server principal "test" is not able to access the database "tracker" under the current security context."
revert

why is that one database acts differently than the other. what setting is that?

thanks
0
Comment
Question by:anushahanna
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 33701494
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33701603
valli_an
in object explorer details, I see only one column - Name. So should not be a problem, i would thinking.

DB chaining is off.

i checked in sys.databases for ROSE_IT and tracker databases, and all bit values are the same.
0
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 500 total points
ID: 33702231
Did you try this comment from the 2nd link:

This appears to be a Login/Database Mapping issue.  I was having this problem, but was able to resolve it as follows:

 

Using the SQL Server management Studio:

In the Object explorer, under the SERVER security folder (not the database security folder), expand Logins.

That is: ServerName -> Security -> Logins

NOT: ServerName -> Databases -> DatabaseName -> Security -> Users

Select the Login that is having the troubles.  Right click on the Login and select ‘Properties.’

 

The ‘User Mapping’ page should list all databases on the server with a check mark on the databases that the Login has been mapped to.  When I was getting the error, the database in question was not checked (even though the Login was assigned as a User on the database itself).  Map the Login by checking the box next to the database name.  Set the default schema.  Then select the roles for the Login in the Database role membership list box.  I selected db_datareader and public.  After clicking OK to save the changes, the problem was resolved.

 
In order to ‘Map’ the Login, the Login must not already be as User on the database, so you may have to go to the database security (ServerName -> Databases -> DatabaseName -> Security -> Users) and delete the Login from the list of database Users before mapping the Login to the database.

hth
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33703745
got you. thanks.

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
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.

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now