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

Can I do Link Table (like Access) on SQL Server. 1

Status
Not open for further replies.

Adhie

Programmer
Mar 17, 2003
28
SG
Hi,

I got problem while doing database integration. I need to distribute a table on the database to another databases by link it up.
I know I it works on Ms. Access. So what should I do instead of using replication?

Thank for your help.
[2thumbsup]
 
not sure exactly what you mean but here is some info
While linked tables in SQL are not supported you can create views, stored procedures and even queries that use tables in other databases. If you have appropriate rights and the other database is a SQL server database you can just use the 4 part name ie Server.Database.Owner.Object instead of just defaulting with just Object
If your database is not SQL server but has a OLEDB provider then you can either
A) set up a linked server and use the OPENQUERY TSQL Function
or
B) use the OPENROWSET TSQL Function and provide the needed connection information.
 
There is no method to link tables from one database into another database. In SQL Server you can reference a table in another databse by using the three-part table name -database.owner.tablename. For example, the following query joins a table in DB2 to a table in DB1,

Select e.EventName, s.StartDate
From DB1.dbo.Events e
Inner Join DB2.dbo.EventSchedule s
On e.EventID=b.EventID
Where e.EventName = 'Utah Symphony Concert' If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Thank you for all, specially for tlbroadbent, your solution is applicable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top