Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing two tables in different databases in the same stored proce

Status
Not open for further replies.

rushdib

Programmer
Jun 12, 2001
203
US
Hi,
I have a stored procedure in database 1 to insert rows from table1 to table2. This insert statement uses a third table table3 which exist in database 2. How do I refer to that table inside the insert statement?
I am calling the procedure from Access using ADO connection with a connection string. Do I have to open database 2?

Thanks in advance,

Rushdi
 
No, you need a distributed query. The name of table must be fully qualified i.e. db_name.dbo.table_name.
Also make sure that DTC service is running.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top