Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database and owner specification during select

Status
Not open for further replies.

kindus

IS-IT--Management
Jul 25, 2001
77
US
Hi,
I got two questions now
1) I have two tables dbo.emp and myuser.emp, I login thru query analyzer using my login myuser which connected user myuser in the database. Whenever I user select without ownername, it select from dbo.emp not from myuser.emp

2) How do I select from a table in a different database specifying the owner of the table?

e.g. select * from pubs..emp

it works but it selects from dbo.emp, what I want is to select from myuser.emp in pubs

Could anybody explain these ??
 

If MyUser is a system administrator, then MyUser is mapped to database owner (dbo) by default. Therefore, when MyUser attempts to access a table owned by MyUser, the statement will fail. You need to explicitely name the table owner as noted by foxdev. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top