Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-07-22 : 11:48:27
|
| Right now I am querying 2 tables in 2 different dbs on the same server. Is it possible to query a table on a different db server?SELECT PUSR, PLINFROM SECFIL.dbo.UPLNMINNER JOIN ITEMBL ON SECFIL.dbo.UPLNM.PLNR = AMFLIB.dbo.ITEMBL.PLANIBWHERE ITNBR = '#Session.arrParts[i][3]#' |
|
|
shan74
Starting Member
2 Posts |
Posted - 2005-07-22 : 12:05:23
|
| You should be able to do this as long as you have added the other server in your linked servers. For adding the other server to the linked server,goto the SQL Enterprise manager, select security-->Linked servers-->Add linked server. Please give appropiate privilege for the login you are using to access the linked server. |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-07-22 : 13:10:45
|
| Yeah they are linked up, what would the SQL look like? |
 |
|
|
shan74
Starting Member
2 Posts |
Posted - 2005-07-22 : 14:17:37
|
| select [A.columnlist], [B.columnlist]from localserver.dbname.dbuser.table A, linkedserver.dbname.dbuser.table Bwhere A.columnlist = B.columnlist (or the join condition you want) |
 |
|
|
|
|
|