Solved

default setting for  login to access database

Posted on 2010-09-17
4
439 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

911 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

18 Experts available now in Live!

Get 1:1 Help Now