Solved

default setting for  login to access database

Posted on 2010-09-17
4
460 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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.

631 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