Oct 16, 2003 #1 hencyt MIS Joined Mar 14, 2003 Messages 122 Location US Can someone tell me how to create a view using tables from 2 different databases? Thanks, Sunny
Oct 16, 2003 #2 JamesLean Programmer Joined Dec 13, 2002 Messages 3,059 Location GB Just qualify the names of your tables using database.owner.table (you can omit the owner if it is dbo). Code: CREATE VIEW myview AS SELECT t1.col1, t2.col2 FROM db1..table1 t1 JOIN db2..table2 t2 ON t1.id = t2.id GO --James Upvote 0 Downvote
Just qualify the names of your tables using database.owner.table (you can omit the owner if it is dbo). Code: CREATE VIEW myview AS SELECT t1.col1, t2.col2 FROM db1..table1 t1 JOIN db2..table2 t2 ON t1.id = t2.id GO --James
Oct 16, 2003 Thread starter #3 hencyt MIS Joined Mar 14, 2003 Messages 122 Location US Thanks James! Sunny Upvote 0 Downvote