Created a user with permissions to one table, but unable to access the table

I've tried to create a Login that will have access to a single table from a few different databases.
When I try and query the table, using the created Login I get the following error:
"The server principal "log_Reader" is not able to access the database "MyDB" under the current security context."
Here's the SQL I used to create the Login/User:
USE MASTER
GO
CREATE LOGIN log_Reader
WITH PASSWORD = '<password>'
GO
USE DB1
GO
CREATE USER log_Reader FOR LOGIN log_Reader
GRANT SELECT ON dbo.logtable TO log_Reader
USE DB2
GO
CREATE USER log_Reader FOR LOGIN log_Reader
GRANT SELECT ON dbo.logtable TO log_Reader
USE DB3
GO
CREATE USER log_Reader FOR LOGIN log_Reader
GRANT SELECT ON dbo.logtable TO log_Reader
USE DB4
GO
CREATE USER log_Reader FOR LOGIN log_Reader
GRANT SELECT ON dbo.logtable TO log_Reader
Does anyone have any ideas what I've missed ?
Thanks, Jason
MCITP BI Developer - MCTS SQL Server (http://bichopsuey.wordpress.com/)

I cannot reproduce the error, can you run my script?
USE [master]
GO
CREATE LOGIN [test1] WITH PASSWORD=N'test',
 DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [B]
GO
CREATE TABLE [dbo].[t1](
[c] [int] NULL,
[c2] [char](1) NULL
) ON [PRIMARY]
CREATE USER [test1] FOR LOGIN [test1] WITH DEFAULT_SCHEMA=[dbo]
GO
GRANT SELECT ON [t1] TO [test1]
EXECUTE AS USER = 'test1';
--Use B database
SELECT * FROM [t1] ---works
REVERT
USE master
GO
EXECUTE AS USER = 'test1';
SELECT * FROM B.dbo.[t1] ---works
REVERT
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • How to create new user with more than one default folder

    hi
    A new user created in OCS has only one default folder(Inbox).
    I want to create new user with customized default folder.
    for example:
    a new user has more than one default folder(Inbox,Outbox,Draft,Dustbin...)
    And also I want to automaticly enable the functions:
    When sending messages, place a copy in Outbox
    Keep message drafts in Draft
    Move deleted messages to Dustbin
    who know that?
    thanks

    The same reason that Apple and 3rd Party vendors put multi-size templates in one file I expect. I am trying to construct an in-house standard template for use in our company, and it is easier to manage if there is only one file to send to people rather than many - both initially and for subsequent edits / updates to the template.
    Of course it would be possible to create several templates (one for each size). But since it is clear that templates can be combined, it appears sensible to do this - unless the doing of it is horridly complicated

  • Unable to descripe the table and unable to drop the table

    Hi,
    I have a temp table that we use like staging table to import the data in to the main table through some scheduled procedures.And that will dropped every day and will be created through the script.
    Some how while I am trying to drop the table manually got hanged, There after I could not find that table in dba_objects, dba_tables or any where.
    But Now I am unable to create that table manually(Keep on running the create command with out giving any error), Even I am not getting any error (keep on running )if I give drop/desc of table.
    Can you please any one help on this ? Is it some where got stored the table in DB or do we any option to repair the table ?
    SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE,STATUS from dba_objects where OBJECT_NAME like 'TEMP%';
    no rows selected
    SQL> desc temp
    Thank in advance.

    Hi,
    if this table drops then it moved DBA_RECYCLEBIN table. and also original name of its changed automatically by oracle.
    For example :
    SQL> create table tst (col varchar2(10), row_chng_dt date);
    Table created.
    SQL> insert into tst values ('Version1', sysdate);
    1 row created.
    SQL> select * from tst ;
    COL        ROW_CHNG
    Version1   16:10:03
    If the RECYCLEBIN initialization parameter is set to ON (the default in 10g), then dropping this table will place it in the recyclebin:
    SQL> drop table tst;
    Table dropped.
    SQL> select object_name, original_name, type, can_undrop as "UND", can_purge as "PUR", droptime
      2  from recyclebin
    SQL> /
    OBJECT_NAME                    ORIGINAL_NAME TYPE  UND PUR DROPTIME
    BIN$HGnc55/7rRPgQPeM/qQoRw==$0 TST           TABLE YES YES 2013-10-08:16:10:12
    All that happened to the table when we dropped it was that it got renamed. The table data is still there and can be queried just like a normal table:
    SQL> alter session set nls_date_format='HH24:MI:SS' ;
    Session altered.
    SQL> select * from "BIN$HGnc55/7rRPgQPeM/qQoRw==$0" ;
    COL        ROW_CHNG
    Version1   16:10:03
    Since the table data is still there, it's very easy to "undrop" the table. This operation is known as a "flashback drop". The command is FLASHBACK TABLE... TO BEFORE DROP, and it simply renames the BIN$... table to its original name:
    SQL> flashback table tst to before drop;
    Flashback complete.
    SQL> select * from tst ;
    COL        ROW_CHNG
    Version1   16:10:03
    SQL> select * from recyclebin ;
    no rows selected
    It's important to know that after you've dropped a table, it has only been renamed; the table segments are still sitting there in your tablespace, unchanged, taking up space. This space still counts against your user tablespace quotas, as well as filling up the tablespace. It will not be reclaimed until you get the table out of the recyclebin. You can remove an object from the recyclebin by restoring it, or by purging it from the recyclebin.
    SQL> select object_name, original_name, type, can_undrop as "UND", can_purge as "PUR", droptime
      2  from recyclebin
    SQL> /
    OBJECT_NAME                    ORIGINAL_NAME TYPE                      UND PUR DROPTIME
    BIN$HGnc55/7rRPgQPeM/qQoRw==$0 TST           TABLE                     YES YES 2006-09-01:16:10:12
    SQL> purge table "BIN$HGnc55/7rRPgQPeM/qQoRw==$0" ;
    Table purged.
    SQL> select * from recyclebin ;
    no rows selected
    Thank you
    And check this link:
    http://www.orafaq.com/node/968
    http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables011.htm
    Thank you

  • I  have  purchased   british library  apps.  but  unable  to  access   the  collection   even  i  bought one month  subscription.   done  all  possible   way .  .

    i  am  facing  a  real trouble  to use   British Library apps ,  i have  done   all possible  ways  to    rectify  but invain.  i  bought   one  month subscription as well.

    Well I got something going on here.   I opened Parallels > Windows 7.  Turned on and registered iTunes in Windows.  It asked for an Airplay pin number.   I put one in and I was able to pull up my iTunes library.   But the one in Windows was empty, so I dragged about a dozen movies over from my iMac iTunes into the movie library of the Windows iTunes.  And then I could watch the movies on my TV using ATV from Windows.   For the next couple of hours I kept messing with both iTunes, loosing Apple TV connection to my computer a couple of times.   Now, in order to see my IMac iTunes library, I have to open my iMac iTunes program, then open Parallels>Windows7>iTunes in order to view the videos in my iMac iTunes folder. What is this all about?  Pretty convoluted way to see a movie.
    Also, I cannot figure out how to see my iMac desktop (or drives) on Parallels, so I really don't understand the connection with the two iTune libraries.  Both Libraries do show up on my TV under Apple TV> Computers.
    When I open the Windows iTunes windows, a SHARED section opens  up in my Imac iTunes, on the sidebar.  When I close the Windows iTunes Window, it goes away.  How can I get it to stay on, without using the Windows partition?
    Why didn't the iMac iTunes ask for an Airplay pin?  What is that? 
    Didn't remember seeing anything like this in the Apple Support Communities.

  • How does one create a user with a null password in iManager?

    I'm setting up LDAP authentication and need to create a user with a null password.
    If you do not put a password in the password field when creating the user in iManager, a message pops up stating, No password has been defined for this user.
    You are given a choice of:
    Allow user to log in without a password
    - or -
    Do not allow user to log in without a password
    If you choose Do not allow user to log in without a password, there are no complaints.
    When I look at the properties of the newly-created user, however, I note that the "Require a password" checkbox is not filled in.
    That would imply that the answer to the question posed during the user's creation is moot; either answer produces a user that can log in without a password.
    I can then assign the Common Proxy password policy to the user, which does not dictate a minimum length for a password.
    From that point forward, any attempts to leave the password field blank in iManager results in another pop-up message stating:
    "Failure to enter a password will allow the user to login without a password."
    That implies that no password exists for the user, as opposed to a null password.
    Is that correct or are the public and private key for the user object still generated?

    If you do not specify a password, which is what happens when you select
    the 'Do not allow user to log in without a password' option initially, the
    user cannot login. A user with no password (meaning no password exists at
    all, similar to a 'null' in programming) cannot login with a password
    because, of course, they do not have a password.
    If you specify a zero-length string as the password you are effectively
    (and usually) creating a proxy user, for example to be used for the LDAP
    service in eDirectory, and this user can login typing in a password (since
    typing would imply one or more characters) but nevertheless there IS a
    password, but it happens that it is zero-length, so typing nothing for the
    password IS submitting the correct password. This is the option carried
    out by eDirectory when you choose, 'Allow user to log in without a
    password' (the prompt is a little misleading with its "without a password"
    phrase).
    Once you assign a UP policy you are telling the system that there SHOULD
    be a password on the user (and with common proxy there definitely should
    be, probably a strong one at that) so the only option now is whether or
    not the password is zero-length or longer. Obviously longer is the
    correct option for security reasons.
    Good luck.
    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  • I have multiple devices (imacs, lap tops and ipads) all connected to a NAS server.  Can I create a user for myself and one for my wife, and each have our own apple ID, and Itunes accounts, but all share the same media on NAS drives?

    I have multiple devices (iMacs, Lap tops, Ipads) all connected to a Nas Drive.  Can I create a user for myself and one for my wife and we each have our own apple ID's, Itunes etc, but share the same data on the hard drives?  So when she logs in, and sync's her ipads, they will sync with her stuff and when I do the same under my user account, on the same device, my ipads will sync with my stuff?

    You can share the same Apple ID for purchasng form the iTunes and app stores without any problems, but you should all used separate iCloud accounts with separate Apple IDs.  (You are not required to use the same ID for iCloud and other services as you do for the iTunes store.)  This will prevent you from ending up with merged data.  You should also use separate Apple IDs for iMessage and FaceTime or you will end up getting each other's text messages and FaceTime calls.
    This article may be of interest: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/, as well as this video: http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l.

  • Business Management Error: You are attempting to create a user with a domain logon that does not exist. Select another domain logon and try again.

    Hello,
    Suddenly the working CRM is being stopped for some group of users.
    I drilled down to the issue and have checked that the users from Domain in which CRM is installed are having CRM access.
    But for other domain user having problem to access CRM.
    I tried to add a user from a domain which is not of CRM domain then it gives following error.
    "Business Management Error: You are attempting to create a user with a domain logon that does not exist. Select another domain logon and try again.
    <Message>LookupAccountNameW failed with error</Message> "
    The change is made - AD group have upgraded Activer Directory server to 2012 R2
    Please help as the Production CRM is not working for other domain user.

    We have Activer Directory Structure like below.
    One Root Domain says A
    and there are multiple child domain like B,C,D etc...
    B,C and D are all in same level,they are child of A domain.
    There are two way transitive trusts between A and all the child Domain.
    But there is no trust in between B and C and so on.
    Our CRM server is in B domain and B domain's user can access CRM but users of Domain C,D and so on can not access CRM.
    If this post answers your question, please click &quot;Mark As Answer&quot; on the post and &quot;Mark as Helpful&quot;

  • Create New user with ...

    Hi all
    I need to create new user with the following privileges :
    1- access any table data (read only)
    2- access the tables structure (read only)
    3- access the tables relations (read only)
    thanx in advance

    Hi,
    giggs11 wrote:
    I did the following :
    create user youruser identified by yourpassword;
    grant connect to youruser;
    grant SELECT_CATALOG_ROLE to username;
    but I cann't see my tables
    there is no erroExample :-
    Step 1:-
    sql> Conn system/manager@orcl;
    connected.
    step 2:-
    SQL> create user trial identified by trial;
    User created.
    Step 3:-
    SQL> grant connect to trial;
    Grant succeeded.
    SQL>grant SELECT_CATALOG_ROLE to trial;
    Grant succeeded.
    SQL> grant select any table to trial;
    Grant succeeded.
    Step 4:
    SQL> conn trial/trial@orcl;
    Connected.
    SQL> select * from tab;
    no rows selected
    Step 5:
    SQL> select * from scott.dept;
    DEPTNO DNAME LOC
    10 ACCOUNTING NEW YORK
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    Step 6:
    SQL> desc scott.dept;
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    you must read about privileges..
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/privs.htm
    Regards
    S.Azar
    DBA
    "Question is Unquestionable"
    Edited by: azarmohds on Aug 15, 2009 6:28 AM
    Edited by: azarmohds on Aug 15, 2009 6:32 AM

  • How can I create a user with rights to install packages on a publish instance?

    Hi,
    I am trying to create a user with the rights to upload and install content packages on a CQ publish instance and I do not wish to use the admin user.  Simply adding a new user to the administrators group does not seem to be enough.
    I tried adding a rep:GrantACE node through crx de/explorer but it reported the node as locked.  I was able to upload a content package that removed the rep:DenyACE jcr:read for everyone, but this is not safe it seems.
    Is there some special privilege that I need to add to my user/group that will allow them to access the /etc/packages tree or do I just need to add some permission somewhere within the tree.
    Regards,
    Chris

    With some help from David Collie, Alex Klimetschek & Jörg Hoh I have a better idea of what is going on and we've found a solution. 
    It seems that the admin account always works in these scenarios as it has special privileges in the CRX security system; admin can do anything it likes.
    Instead of creating the rep:GrantACE nodes directly, I was able to add a new ACL entry for the administrators group to /etc/packages via the Access Control Editor (http://localhost:4502/crx/explorer/ui/aceditor.jsp?ck=1373027669916&Name=acEditor&Path=%2F etc%2Fpackages&_charset_=utf-8). 
    Strangely, the administrators account already had some inherited rights on this directory that were overridden by the deny|everyone|jcr:read ACL entry on /etc/packages node.  Adding allow:administrators|jcr:read gives any member of that group access to read and write to the /etc/packages. directory.
    Now that I have setup this user we can setup a deploy step in out CI build that does not rely on using the admin account.
    Thanks
    Chris

  • How to create a user with read only access for ESB / BPEL Console

    I need to create a user with read only access to ESB Console & BPEL Console. I have created a user
    (esbreadonly) and assigned ascontrol_monitor role but user is still able to
    delete services from ESB systems (such as DefaultSystem). Is there any way to
    create a user that has strickly read only access to ESB Console & BPEL
    Console
    Thanks
    Dinesh Patel

    Check out this post.. I'm in the process of testing.
    http://chintanblog.blogspot.com/2007/12/i-saw-numerous-people-asking-about-bpel_290.html

  • Failed to create a user with Mac Mini Server, the message "Failed to process the command writesettings" in the module "servermgr_sharing"

    Failed to create a user with Mac Mini Server, the message "Failed to process the command writesettings" in the module "servermgr_sharing"

    I have a Mac Mini with OS X Server 10.8.5 and Server 2.2.1 and have a problem to share the public folder.
    When I enter the Server application to indicate that I want to share the public folder on the network and assign user I get the following message appears
    And I can not share the folder.
    If I go from my i-mac get mac mini server view and access the public folder, but I can not open any of the files there.
    That I can do to fix this?
    thank you very much

  • Some errors in creating AD user with mailbox enabled

    Dear adler Steven / all,
    I followed all your posts and able to create AD user with mail box enabled, Now i am able to send and receive mails for this user.
    But the user in AD is disabled , that is it is not with the icon of an enabled user but it has an icon of user with a cross marked in Red.
    i have given the successful coding below:
    attrs.put("cn","chngcode");
    attrs.put("instanceType","4");
    attrs.put("objectCategory","CN=Person,CN=Schema,CN=Configuration,DC=csindia,DC=com");
    attrs.put("objectClass","top");
    attrs.put("objectClass","person");
    attrs.put("objectClass","organizationalPerson");
    attrs.put("objectClass","user");
    attrs.put("mailNickname","chngcode");
    attrs.put("mail","[email protected]");
    attrs.put("sAMAccountName","chngcode");
    attrs.put("msExchHomeServerName","/o=CYGNUS_O/ou=CSINDIA/cn=Configuration/cn=Servers/cn=CSISERVER2");
    attrs.put("objectCategory","CN=Person,CN=Schema,CN=Configuration,DC=csindia,DC=com");
    attrs.put("userPrincipalName","[email protected]");
    attrs.put("distinguishedName","CN=chngcode,CN=Users,DC=csindia,DC=com");
    attrs.put("instanceType","4");
    attrs.put("mDBUseDefaults","TRUE");
    attrs.put("name","chngcode");
    attrs.put("replicatedObjectVersion","0");
    attrs.put("legacyExchangeDN","/o=CYGNUS_O/ou=CSINDIA/cn=Recipients/cn=chngcode");
    attrs.put("givenName","chngcode");
    attrs.put("displayName","chngcode");
    // Create the context
    Context result = ctx.createSubcontext(userName, attrs); Help me on further process :
    -How to solve the above bottle neck , Is any thing missed for above?
    - I have not set the password thru codings. what to do on this ?
    -When/where to use the homeMDB attributes ( Is it necessary to use this homeMDB ? )
    -How to create the mailbox with in a store ? (Presently i have created the mail box in Recipients container for this AD user)
    Expecting your early enlightening on this..
    Advanced thanks for your efforts.
    By,
    Softeek.

    If you refer to the post titled "JNDI, Active Directory (Creating new users & demystifying userAccountControl)" at http://forum.java.sun.com/thread.jspa?threadID=582103&tstart=15 you wil notice that because of the stricter security in Windows Server 2003 Active Directory, user accounts created with null passwords are automagically disabled.
    To enable new user accounts you must assign a password (that meets the security policy !) and then enable the account.

  • Hello. I have an iPad2, and iMovie software. My main problem, for the moment, is the length of the videos: I can´t create a video with more than 56 seconds. When I try, the app shuts off... Can anyone help me?

    Hello. I have an iPad2, and iMovie software. My main problem, for the moment, is the length of the videos: I can´t create a video with more than 56 seconds. When I try, the app shuts off... Can anyone help me?

    Sorry. We can't help you. It's no longer an iPhone. Apple won't touch it.
    Take it to whoever replaced the screen and see if they can help you.
    iPhones are not user servicable and Apple does not sell iPhone parts at all. I'd be surprised if you were actually able to back it up at this point. It sounds like it's completely borked.

  • Unable to load the tables in the Power Pivot Window – An Item with the Same Key has already been added

    Hi there,
    I recently had the following situation, where I changed the source of my CSV file in Power Query.
    Once I had reloaded the file, it would then not load into Power Pivot. So I disabled the loading from Power Query into Power Pivot. I then enabled the loading to the Data Model. Which then successfully loaded the data into Power Pivot.
    But once I went into Power Pivot, had a look, then saved the Excel file. Once saved I closed the Excel file. I then opened the Excel file again and all the sheets that interact with the Power Pivot data work fine.
    But if I go and open Power Pivot I get the following error: Unable to load the tables in the Power Pivot Window – An Item with the Same Key has already been added.
    This is what I get from the Call Stack
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.AnalysisServices.Common.LinguisticModeling.SynonymModel.AddSynonymCollection(DataModelingColumn column, SynonymCollection synonyms)
       at Microsoft.AnalysisServices.Common.LinguisticModeling.LinguisticSchemaLoader.DeserializeSynonymModelFromSchema()
       at Microsoft.AnalysisServices.Common.SandboxEditor.LoadLinguisticDesignerState()
       at Microsoft.AnalysisServices.Common.SandboxEditor.set_Sandbox(DataModelingSandbox value)
       at Microsoft.AnalysisServices.XLHost.Modeler.ClientWindow.RefreshClientWindow(String tableName)
    I would assume that the issue is with the synonyms and for some reason, when I disabled the loading of my data into the Power Pivot Model, it did not remove the associations to the actual table and synonyms.
    If I renamed the table in Power Pivot it all works fine. So that was my work around. Fortunately I did have a copy of the Excel workbook before I made this change. So I could then go and add back in all the relevant data to my table.
    Has anyone had this before and know how to fix it?
    http://www.bidn.com/blogs/guavaq

    Hi there
    I can share the work book, if possible to send me an email address. As the workbook size is about 9Mb.
    Thanks
    Gilbert
    http://www.bidn.com/blogs/guavaq

  • I have my iphone 5 set up with Itunes on one computer, but I recently just bought my own computer. How do I set up my Iphone with the new Itunes account? Its telling me it can only be set up with one account. Do I have to delete the other account?

    i have my iphone set up with itunes on one computer, but i recently bought my own computer. How do I set up my iphone with the new itunes account? It says my phone can only be set up woth one itunes account. How do I remove the previous account?

    ThisGal_Drea wrote:
    i have my iphone set up with itunes on one computer, but i recently bought my own computer. How do I set up my iphone with the new itunes account?
    Do you mean iTunes library?
    iTunes account is what you use to make iTunes purcahses.
    iTunes library is what is on your computer.
    It says my phone can only be set up woth one itunes account. How do I remove the previous account?
    No, it tells you it can only be sync'd with one iTunes library.
    Simplest way is to copy the entire /Music/iTunes/ folder (thisis the iTunes library) from old computer to new computer.

Maybe you are looking for

  • How to run Sales order interface

    Hi All, I am trying to perform a task in vision instance. The task is creating a test data in a excel sheet and writing a code for moving the data from excel sheet to order interface tables and then run a concurrent program to move data from interfac

  • To find the table name using field name

    Hi, Do we have any transaction code using field name to find out the table name Regards, P.Arunkumar.

  • HP Phoenix computer can't detect second monitor

    HI, I have used this for a while (18 months) on one monitor and wanted to extend the desktop to a second monitor - but the system fails to detect a second monitor when it is plugged in. It has an AMD Radeon 6850 with two DVi slots - both monitors wor

  • Itunes 7.7 won't close

    installed 7.7 on windows, itunes hangs when closed using either "X" or file/exit. Using Windows xp sp3, nod32 antivirus. Any ideas

  • Crystal reports 2008 install freezes on disk space req.

    Unable to install Crystal reports 2008 on server - Windows Server 2008 standard. This is required moving forward for troubleshooting purposes. The installation freezes when determining disk space requirements. I have tried copying the installation fi