Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Native Client driver choice by SQL Agent


Native Client driver choice by SQL Agent

Author
Message
jwick
jwick
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 53
How does the SQL Agent choose what version of the NC driver to use when connecting to linked servers? and/or how do you force the Agent to use a specific one using T-SQL?

Case in point:
I'm working on a stored proc on a Central Mgmt Server (CMS) that has linked server objects to other servers (ServerA - 2005, ServerB - 2008, ServerC - 2012).
The proc has a loop that connects to each server in CMS.master.sys.servers, gets some information/does some actions, then goes to the next server.
If the CMS connects to the servers in Ascending order (by SQL version), everything works fine.
If the CMS connects to a newer server (ServerB) and then an older one (ServerA), the job fails with error:
Msg 7314, Sev 16, State 1, Line 1 : The OLE DB provider "SQLNCLI11" for linked server "ServerA" does not contain the table ""master"."sys"."xxxxxxx"". The table either does not exist or the current user does not have permissions on that table. [SQLSTATE 42000]

The only solution I can think of is to hard code the server list into the stored proc in the correct connection order. Which is a bad way to do it, in my opinion. I'd rather have the agent recheck what driver it's using when connecting to each server, or tell it to use the 2005 NC driver for all connections.

Thoughts/Ideas?

Cheers,
J
jwick
jwick
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 53
Disregard problem. Turns out a variable (storing version specific info) wasn't being cleared at the end of each loop.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search