Friday, March 23, 2012
Reflecting changes in production Db onto staging DB
Thanks.I'd recommend backup and restore. I've never found anything else that completely satisfies me.
-PatP
Friday, March 9, 2012
Reference 2 Databases in SQL Statement
I need to join a table with another table in a different database. Is this possible?
Assume Table1 is in DB1 and Table2 is in DB2.
Thanks!
Brian
Simple, just prefrace the table name with the database name.
e.g. SELECT * FROM database1..table1 JOIN database2..table2 ON ...
|||Brian:
It should simply be something like:
Code Snippet
select <columnList>
from Db1.schema1.Table1
join Db2.schema2.Table2
...
|||search for "linked servers"
Reference 2 Databases in SQL Statement
I need to join a table with another table in a different database. Is this possible?
Assume Table1 is in DB1 and Table2 is in DB2.
Thanks!
Brian
Simple, just prefrace the table name with the database name.
e.g. SELECT * FROM database1..table1 JOIN database2..table2 ON ...
|||Brian:
It should simply be something like:
Code Snippet
select <columnList>
from Db1.schema1.Table1
join Db2.schema2.Table2
...
|||search for "linked servers"