syntax to change Access linked server data source

Using SQL Server 2008 R2.

I've got an Access database file configured as a linked server.  I use this to push data from a data warehouse to an application used by some of our engineers.  About once a quarter, the engineers take a snapshot of their data, create a copy of this backend, and save this copy to a new folder on the network.  They then ask me to change the linked server to point to this new file.

I know, it seems like they could simply make a copy and save the copy but continue to populate the same database as the linked server datasource, but I cannot convince them to do that.  So, I'm looking for a T-SQL command that would allow me to change the file that the linked server points to, without having to drop the linked server and create a new one.

When I open the properties dialog for the linked server, I cannot simply change the data source, as that field is disabled.
LVL 50
Dale FyeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

plusone3055Commented:
there is a built in Stored procedure in SQL server that you can use sp_setnetname

here is the microsoft article that contains the syntax  you can use to build :)
https://msdn.microsoft.com/en-us/library/ms190318.aspx
0
Dale FyeAuthor Commented:
Thanks,

Still trying to resolve another issue before I can test this solution.   Will get back to it soon.

Dale
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeAuthor Commented:
The previous answer did not work, as it only works for linked SQL Servers, not Access Databases.

What I ended up doing was right clicking on the Linked Access database in the Linked Servers section then scripting that for a drop and create, and changing the file name in the resulting text.  This also provided code for updating a variety of the options associated with the linked server.  Now to modify that code in an SP so that I can pass in the old and new names drop the old, and add the new.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.