When I try to do a remote query as follow
select * from server1.retail..customers
the query fails, but if ran the same query with dbo
select * from server1.retail.dbo.customers, then it works.
Why is this happening, I thought dbo. or .. was the same.
Thanks in advanceTom,
>> Why is this happening, I thought dbo. or .. was the same.
No.If you login to SQL Server using the login 'tom' and then you say select
* from server1.retail..customers, it looks for 'customers' which is created
by the objectowner 'tom'.Normally, all database objects should be created by
'dbo' in order to avoid this confusion.Even otherwise, its a good practice
to prefix the objectowner name explicitly as in select * from dbo.customers.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"tom" <tom@.hotmail.com> wrote in message
news:0d9401c36e47$15161d10$a501280a@.phx.gbl...
> When I try to do a remote query as follow
> select * from server1.retail..customers
> the query fails, but if ran the same query with dbo
> select * from server1.retail.dbo.customers, then it works.
> Why is this happening, I thought dbo. or .. was the same.
> Thanks in advance
>|||I am sa on the server and all the objects are owned by dbo.
thanks for you help
>--Original Message--
>Tom,
>> Why is this happening, I thought dbo. or .. was the
same.
>No.If you login to SQL Server using the login 'tom' and
then you say select
>* from server1.retail..customers, it looks
for 'customers' which is created
>by the objectowner 'tom'.Normally, all database objects
should be created by
>'dbo' in order to avoid this confusion.Even otherwise,
its a good practice
>to prefix the objectowner name explicitly as in select *
from dbo.customers.
>--
>Dinesh.
>SQL Server FAQ at
>http://www.tkdinesh.com
>"tom" <tom@.hotmail.com> wrote in message
>news:0d9401c36e47$15161d10$a501280a@.phx.gbl...
>> When I try to do a remote query as follow
>> select * from server1.retail..customers
>> the query fails, but if ran the same query with dbo
>> select * from server1.retail.dbo.customers, then it
works.
>> Why is this happening, I thought dbo. or .. was the
same.
>> Thanks in advance
>>
>
>.
>|||Tom,
Its because you are querying a remote server.Always use fully qualified
names when working with objects on linked servers including the object owner
name,in this case, 'dbo'.In linked servers, there is no support for implicit
resolution of .. to the dbo owner name for tables .
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"tom" <tom@.hotmail.com> wrote in message
news:011e01c36e49$c1123610$a301280a@.phx.gbl...
> I am sa on the server and all the objects are owned by dbo.
> thanks for you help
>
> >--Original Message--
> >Tom,
> >
> >> Why is this happening, I thought dbo. or .. was the
> same.
> >
> >No.If you login to SQL Server using the login 'tom' and
> then you say select
> >* from server1.retail..customers, it looks
> for 'customers' which is created
> >by the objectowner 'tom'.Normally, all database objects
> should be created by
> >'dbo' in order to avoid this confusion.Even otherwise,
> its a good practice
> >to prefix the objectowner name explicitly as in select *
> from dbo.customers.
> >
> >--
> >Dinesh.
> >SQL Server FAQ at
> >http://www.tkdinesh.com
> >
> >"tom" <tom@.hotmail.com> wrote in message
> >news:0d9401c36e47$15161d10$a501280a@.phx.gbl...
> >> When I try to do a remote query as follow
> >>
> >> select * from server1.retail..customers
> >>
> >> the query fails, but if ran the same query with dbo
> >>
> >> select * from server1.retail.dbo.customers, then it
> works.
> >>
> >> Why is this happening, I thought dbo. or .. was the
> same.
> >>
> >> Thanks in advance
> >>
> >>
> >
> >
> >.
> >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment