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 |
|
inferno
Starting Member
2 Posts |
Posted - 2002-08-08 : 19:48:44
|
| Is it possible to write transact SQL to read/write across multiple databases?? |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-08-08 : 19:51:52
|
| Sure. |
 |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-08-08 : 19:59:35
|
You can refer to tables in other databases using 3 part naminguse pubsgoselect * from Northwind.dbo.Customersgo HTHJasper Smith |
 |
|
|
inferno
Starting Member
2 Posts |
Posted - 2002-08-08 : 20:20:50
|
| Can you go across databases in a stored procedure? |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-08-08 : 20:22:24
|
| Sure. |
 |
|
|
JustinBigelow
SQL Gigolo
1157 Posts |
Posted - 2002-08-08 : 22:02:45
|
quote: Sure.
I see a trend forming. You can do across databases with the 3 part naming scheme like jasper stated. create proc GetCustomersasselect * from Northwind.dbo.CustomersYou can also execute a procedure that resides in another database.exec DB1.dbo.GetCustomershth,Justin |
 |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-08-09 : 08:47:02
|
Sure |
 |
|
|
|
|
|