December 20, 2010 at 9:29 am
Hi All,
I'm trying to link 2 servers to enable me query them at the same time. Does anyone know how I can link them? Any input will be appreciated.
Thanks
December 20, 2010 at 9:36 am
You could create a linked server on each to the other - look under server objects in SSMS then you can query them like
SELECT
*
FROM myTable a
INNER JOIN [otherserver].[mydb].[dbo].[myTable] b ON a.PKVal = b.PKVal
--------------------------
I long for a job where my databases dont have any pesky users accessing them 🙂
December 20, 2010 at 11:44 am
The first response is the right track. I would caution you on how you use linked servers. Do not do large table joins, query for discrete recordsets.
While the DB engine often does a good job building the query that is run on the remote server, it as often does not. Add a third server into the mix and it gets messy.
Linked servers can be handy, but take it from someone who over-used them in the past, they can also cause all sorts of stability problems.
Now I often look at how much data I need, how big it is on disk, how current it needs to be, and what my *real* business requirements are. By real I mean what is practical and necessary, far too often the business requirements I have seen do not represent the real world and need to be challenged.
I'll climb off my soapbox now.. Just be cautious.
CEWII
December 20, 2010 at 12:06 pm
Thanks for the guidances All. After creating the linked server and try to run a query, I get this error message
"Msg 7430, Level 16, State 3, Line 1
Out-of-process use of OLE DB provider "SQLNCLI" with SQL Server is not supported"
Looks like am doing something wrong..please help!
December 20, 2010 at 12:27 pm
Under linked servers|Providers, if you get the properties of SQLNCLI10, is the "All inprocess" box checked?
If not, check it, you might have to restart SQL to get it to work for wait for 10 minutes or so..
CEWII
December 20, 2010 at 1:03 pm
I'm actually linking sqlserver 2005 and sql server 2008. From 2008 to 2005 the connection is successful but from 2005 to 2008, I get this error " test connection to the linked server failed' What can be causing this? Inputs will be appreciated.
December 20, 2010 at 1:33 pm
Is there a SQLNCLI in the providers list? I don't have a 2005 available at the moment so I can't answer it myself. but look at my questions above and answer them.
CEWII
December 20, 2010 at 1:36 pm
Yes, there is an SQLNCLI in the 2005 provider list.
December 20, 2010 at 1:44 pm
In the properties of that provider is the Allow inprocess option checked?
CEWII
December 20, 2010 at 2:01 pm
Yes it is checked.
December 20, 2010 at 3:42 pm
Thanks All. I got it situated. I appreciate all your inputs
January 6, 2011 at 9:50 am
Hi i've found your thread here and i am having the same problem, could you say how you resolved this please?
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply