Cannot query a table without adding a prefix



Hello,

This may be a common dilemma but I just cannot seem to resolve it.

I'm using SQL 2005 by logging into SSMS via my own [DOMAIN\User] account,
which also exists in the SQL Logins and has server roles of 'Public' and
'sysadmin'.

Under 'User Mapping' tab, I do not have a check beside the database (that I'd
like to query without adding any prefix in the FROM clause like FROM testuser.
TABLE) and I have not assigned myself a 'db_owner' right on that database, as
yet because I'd like to start on a clean slate based on what you guys tell me
to do.

Under my database TEST2, Security > Users, I do not see my DOMAIN\User
account because I didn't make myself a dbo, as per paragraph above.

Currently, the TEST2 db has a db owner called 'testuser' which appears on the
db user as well as on the SQL Login.

When I login as testuser in SSMS and query a table, it works fine, However,
what I'd like to do is when I login as myself DOMAIN\User, I should be able
to query the same table without adding a prefix in the FROM testuser.TABLE.

So, the end goal I'd like is that both testuser and DOMAIN\User logins should
be able to query the same table without any prefixes.

Any way to do this in a concise step-by-step manner so that I don't mess it
up :)

Thanks in advance.

--
Message posted via http://www.sqlmonster.com

.



Relevant Pages

  • Re: limit sql agent job resource with resource governor
    ... run below sql query during the run. ... you can't use login name to differentiate. ... the workload group that I have defined and it goes to the default ...
    (microsoft.public.sqlserver.server)
  • RE: Transact: GRANT LOGIN
    ... you can use sp_grantlogin to create a SQL login. ... CREATE LOGIN, continue to use it and you don't need to use sp_grantlogin. ... exec sp_grantlogin 'testUser' ... SQL Server says that 'testUser' is not a valid Windows NT name, ...
    (microsoft.public.sqlserver.programming)
  • Re: Cannot query a table without adding a prefix
    ... the TEST2 db has a db owner called 'testuser' which appears ... on the db user as well as on the SQL Login. ... When I login as testuser in SSMS and query a table, it works fine, ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (microsoft.public.sqlserver.security)
  • Re: Using SQL username as criteria on a view
    ... You can find out the login name of the logged in user running the query by ... >> SQL username: BOB ...
    (microsoft.public.sqlserver.security)
  • [Full-disclosure] Knorr.de SQL Injection and XSS Vulnerabilities
    ... SQL Injection (mainly login authentication bypass + any ... There is a vulnerability using the login field of the site. ... the rest of the SQL query by adding;-- which ends the current query ...
    (Full-Disclosure)

Quantcast