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

Sharing Tables 1

Status
Not open for further replies.
Jul 20, 2001
1,153
US
is there a way to share tabels between databases on the same server ?

I have two distinct applications. Inventory and EDI. They both have thier own front ends, but are using the same back end. This doesn't make sense because theu should have their own tables and SPs except for a few common tabels. These are UPC, Color, Style, etc.




 
You can reference tables in another database by specifying the four-part table name. If the tables are on the same server the server name is not necessary, only the three-part name is required.

Server.Database.Owner.Table

SELECT o_OrderID, c.Color
FROM MyDB.dbo_Orders o
JOIN YourDB.dbo.Color c ON o.ColorID = c.ColorID

I hope this helps. Good luck!

--Angel [rainbow]
-----------------------------------
Every time I lose my mind, I wonder
if it's really worth finding.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top