|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Yesterday @ 2:08 PM
Points: 79,
Visits: 600
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, April 10, 2013 4:23 AM
Points: 18,
Visits: 56
|
|
| Thanks for the details. I am using linked server for accessing data from remote servers. But I wonder whether I need to handle the transactions manually, if I use linked servers for writing data.!! what you think ?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 1:02 AM
Points: 1,277,
Visits: 1,609
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 12:55 AM
Points: 104,
Visits: 116
|
|
| Hi, any specific reason way you don't use the openquery command?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 1:02 AM
Points: 1,277,
Visits: 1,609
|
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 11:19 AM
Points: 58,
Visits: 184
|
|
Linked serverd id quite a big subject with the security levels, ditributed transactions etc.and I think this post could have gone in to a little more detail without detracting from the subject matter.
I think Openquery was worth mentioning and I dont think it was avoided on account of security as the way this linked server example has been set up is highly inssecure anyway.
2 interesting points I think are worth making though.
As a general rule, don't do linked security in the way noted in the article as all connections will be executed remotely with this remote user regardless of the loacal user. Better to map all allowed local users to a remote login and best to use windows security locally if possible.
Secondly there isa gothcha thats worth noting. The linked server with inner join will not work woth XML columns. You would have to use openquery and convert the remote xml field to varchar and then convert it back again.
And finally I would like to mention that, touched on in the article, the copying of a remote table to a local temp table can often be a good idea as this avoids the need for a distributed transaction and therefore reduces overhead and complexity of the security system.
Otherwise I thought the article was a pretty good introduction.
Dave
David Bridge David Bridge Technology Limited www.davidbridgetechnology.com
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, February 01, 2013 8:06 AM
Points: 1,
Visits: 48
|
|
Copying the entire remote table into a local temp table is not an option when the remote table has millions of rows. Have a look at the REMOTE join hint. There are a couple of caveats with this hint, but if one can properly index the remote table, using this join hint provides very good performance.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 1:53 PM
Points: 1,164,
Visits: 3,335
|
|
I agree that it's best to map local logins to an account on the remote server, rather than have all logins access the linked server using a default security context. Otherwise, even an account with nothing but PUBLIC access will have equal access to the linked server.
Mapping local logins to remote accounts can be done even when the remote server doesn't have (or doesn't support) windows authentication. Here is how one my linked servers are configured where the remote server is Oracle. A windows domain account, MYCORP\ReportingUser, can access the linked server under the context of the remote Oracle account, RPT_USER.
Local server login to remote server login mappings:
Local Login: MYCORP\ReportingUser Impersonate: No Remote User: RPT_USER (account on remote Oracle server) Remote Password: ########
For a login not defined in the above list, connections will: - Not be made
"Wise people understand the 10,000 things without going to each one. They know them without having to look at each one, and they transform all without acting on each one." - The Tao Te Ching: Verse 47
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, April 18, 2013 5:18 AM
Points: 32,
Visits: 407
|
|
When I require live data, I almost always join against OPENQUERY resultsets - much, much, MUCH faster than directly joining to the remote server.
Or else an SSIS job.
-sff
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, June 21, 2012 9:03 AM
Points: 5,
Visits: 29
|
|
Nice article. I find in actual use where the person creating the linked server is a company level DBA that providing scripts is a necessary component. Also be aware that you may need to add multiple users (we did). There is also some detail in regards to linking to non-SQL Server servers (Oracle?) that would be useful to see.
Joshua
|
|
|
|