How can I access tables from different databases in the same server in a
query or stored procedure.
Also how to access databases existing in different database servers.
Thanks fro your help.
Retna
Hi,
To access the tables in the databases in same server you can use the below
syntax.
select * from dbname.tableowner.table_name
To access the table in in differenet server u need to create linked server.
AFter that you could use
select * from linkedservername.dbname.tableowner.table_name
See the below article on how to create linked server and execute DML
comamnds.
http://www.microsoft.com/India/msdn/articles/166.aspx
Thanks
Hari
MCDBA
"Retna" <Retna@.discussions.microsoft.com> wrote in message
news:04CD4FE1-0A0F-466C-9EBC-0AEBE55440A8@.microsoft.com...
> How can I access tables from different databases in the same server in a
> query or stored procedure.
> Also how to access databases existing in different database servers.
> Thanks fro your help.
> Retna
|||Thanks Hari for your valuable and timely reply .
Retna
"Hari Prasad" wrote:
> Hi,
> To access the tables in the databases in same server you can use the below
> syntax.
> select * from dbname.tableowner.table_name
> To access the table in in differenet server u need to create linked server.
> AFter that you could use
> select * from linkedservername.dbname.tableowner.table_name
> See the below article on how to create linked server and execute DML
> comamnds.
> http://www.microsoft.com/India/msdn/articles/166.aspx
> Thanks
> Hari
> MCDBA
>
> "Retna" <Retna@.discussions.microsoft.com> wrote in message
> news:04CD4FE1-0A0F-466C-9EBC-0AEBE55440A8@.microsoft.com...
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment