Selasa, 15 Januari 2008

SQL SERVER QUERY FROM 2 DATABASE

this sql query should return records from tables in 2 or more database. it's quite simple just put the database name in front of the table you want to display/query.

SELECT <db1>.<table1>.*, <db2>.<table2> FROM

<db1> LEFT OUTER JOIN <db2>

ON <db1>.<table1>.<key1> = <db2>.<table2>.<key2>

it's easy

Tidak ada komentar:

Posting Komentar