mohanrao
asked on
Query tables in another database
Hi,
i have connected to database X. from this connection i would like to access tables in another database. purpose is to join tables in different database.
Regards,
Rao.
i have connected to database X. from this connection i would like to access tables in another database. purpose is to join tables in different database.
Regards,
Rao.
ASKER
yes, it is two different servers. how can i do this "Linked server setup"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Go to enterprise manager
under security - you will see linked servers
right click on linked server
click on ne linked server
dialog box will open up
in linked server - type the name of the server you want to link
click on security tab
click radio button - they will be mapped to
this is for the remote server
remote user - username
password
at the bottom
login name - enter login name - example sa
remote user - enter username - example sa
when it has successfully created a link
you will see the name of the server
under that you will see tables - nothing else
when you need to query the database from query
analyzer
servername.databasename.db o.tablenam e
under security - you will see linked servers
right click on linked server
click on ne linked server
dialog box will open up
in linked server - type the name of the server you want to link
click on security tab
click radio button - they will be mapped to
this is for the remote server
remote user - username
password
at the bottom
login name - enter login name - example sa
remote user - enter username - example sa
when it has successfully created a link
you will see the name of the server
under that you will see tables - nothing else
when you need to query the database from query
analyzer
servername.databasename.db
dbname.owner.table
to query the table residing in another db.
If the database are on the separate servers, you have to set up one server as linked server on the other (this can but does not have to be bi-directional link), and then use the syntax:
servername.dbname.owner.ta