May 27, 2004 at 7:03 pm
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/kso
August 10, 2004 at 8:01 pm
It's very interesting.
June 2, 2005 at 8:58 pm
Can you link to more than one (eg. sybase) server?
March 24, 2006 at 4:15 am
wow, it is very useful to me.. thank you buddys.... .
June 8, 2007 at 2:20 am
A great article, but something worth noting is that when a query is executed against a linked server using "select stuff from linkedServer.dbName.owner.objectName" SQL Server actually returns all the rows from the table(s) in the linked server and the executes the query locally (using T-SQL syntax), whereas when you use the OpenQuery() syntax the query is passed down to the linked server and only the result set is returned, this means that OpenQuery() needs to use the native syntax of the linked server rather than t-sql (assuming it's not a SQL Server!). This was my experience at least and if I'm slightly off the mark then I'd welcome further comment.
Thanks for an interesting article
June 8, 2007 at 6:01 am
Very good article.
Okay, so when using OPENROWSET, it is using OLE DB. How about using LINKEDSERVER itself? Is it still OLEDB based connection? or ODBC ?
June 8, 2007 at 7:19 am
one more note: Link server does not support access on SQL Server 2005 64 bit
mom
June 8, 2007 at 7:32 am
Very basic article. Even so it is explained in the article header, I would like to add that linked servers were available from SQL 7(or 6.5?) and did not change on introductory level since.
I would also assume that in SQL 7 processinf heterogenous queries had more flexibility than in SQL 2005. I would expect from SQLservercentral publications more indpeth, detailed coverage.
June 8, 2007 at 8:45 am
Very good article.
June 8, 2007 at 9:08 am
Good introduction. I expect more in-depth articles on this subject to follow.
I have used this to attach, remote SQL servers, Access databases, and even text files. I have even heard of attaching DB-400 through Client Access.
Somebody asked about multiples. Yes you can.
ATBCharles Kincaid
June 8, 2007 at 10:10 am
Yes - it can link to multiple servers.
Perhaps this snippet from Books On Line will help:
Relational Database Engine Architecture Overview
Database Engine Components
The relational database server of Microsoft® SQL Server™ 2000 has two main parts: the relational engine and the storage engine. One of the most important architectural changes made in SQL Server version 7.0 was to strictly separate the relational and storage engine components within the server and to have them use the OLE DB API to communicate with each other.
So, in a sense, you have been using a linked server already.
The local SQL server has the local relational engine “linked to” the local storage engine.
You can choose whether the linkage to the linked server is over ODBC or OLEDB.
It depends which driver you use/how you define the datasource.
For each linked server in my care I have a folder with setup scripts and basic test scripts.
Sample contents:
sp_linkedserver
go
sp_tables_ex 'servername'
go
sp_columns_ex 'servername'
go
select from a sample table using four part name
Remember that in query analyzer that the selected/highlighted area is executed (F5) not the whole script, so I can pick out the line(s) of interest or just let the whole thing rip.
Also, I set up a database with views so that an SQL query/script that will run in query analyzer on the target linked server host can run directly. Obviously, if the target linked server is not SQL server, then I have to be selective about what is included.
I like to have a table in each database just for test purposes. This is nothing fancy, couple of columns and three or four rows.
All in all, I can quickly verify if everything is working.
Alternatively, I have actual proven syntax in front of me if something is wrong and my in the middle of the night mental table name, database name and syntax index search isn't quite functioning properly.
On my PC I have a test database that is mirrored in MS Excel, MS Access, MS SQL server 2000, MS SQL Server 2005, DB2 9, MySQL, Oracle 10g, Sybase ASE 15 and Unisys ClearPath DMSII 51.1.
Both the SQL Server 2000 and SQL Server 2005 have these databases as linked servers.
The setup is scripted and so is the basic functionality testing.
Roy
June 13, 2007 at 3:19 pm
Good article!
Can anyone tell me if you can link from SQL Server 2000 to 2005 (not 64 bit) and run queries from SQL Server 2000 against the 2005 server?
Thanks
June 13, 2007 at 3:59 pm
Good article, I learned something about OPENQUERY, which I had not used before.
A few things I have identified while doing linked server queries.
Thanks for the article, some useful stuff.
June 13, 2007 at 4:20 pm
Just tried it. Seems to work. Use the cautions that the others have suggested here. Pretty much if you can pull the data through ODBC it should work.
ATBCharles Kincaid
June 18, 2008 at 7:07 pm
Hi, This is my first post to this Forum.... I am trying to get my head around linked server, stored procedures .... I'd like to see an example of a stored procedure that: 1) links to 'remote' SQL2005 server db 2) performs an update or insert on a linked table and a local table with rollback of the whole transaction if one of the updates / inserts fails (and if possible: give appropriate error message as to which of the updates / inserts in the transaction failed)..... Can someone please help out with this? thanks....
Viewing 15 posts - 1 through 15 (of 28 total)
You must be logged in to reply to this topic. Login to reply