May I know how to issue JOIN statement to join two ID from different DB ?
example:
dbA - tableA - a.ID
dbB- tableB - b.ID
Thanks.
Use DBName..TableName OR DBName.DBO.TableName
For example, SELECT a.SomeColumn FROM a INNER JOIN dbB..b AS bT ON a.ID = bt.ID
|||The syntax is [server].[database].[schema].[table] for table names, you can reference the table(s) as:
tableA or dbo.tableA or dbA.dbo.tableA or myserver.dbA.dbo.tableA.
If you need to reference a table in a different schema, you must use 2-part (or more) table names. If you want to reference a table that is in a different database, use 3-part (or more). If you want to reference a table on a different server, use 4-part.
No comments:
Post a Comment