Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

default setting for  login to access database

Posted on 2010-09-17
4
Medium Priority
?
467 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

886 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