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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting data from two databases 2

Status
Not open for further replies.

shaminda

Programmer
Jun 9, 2000
170
0
0
US
I have a database (say database1). In this database I have a stored procedure (say sp1). The stored procedure selects data from a table (say table1). Instead of selecting data from table1 database1, I want to select the data from table2 database2. But the stored procedure will be in database1. Is this feasible? If it is how do I do it? Any help will be appreciated.
 
Use a three part name like database.owner.objectName to fully qualify the table to access.

eg. Select * from NorthWind.dbo.Customers

HTH,
Vinod Kumar
 
I got it working using database2.dbo.table2. Thank you all for your help and fast response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top