Options

how to get change with missing linkedserver

dccorreadccorrea Posts: 3 New member
edited November 8, 2017 12:03PM in SQL Source Control
I'm trying to pull a change in my local database, but the procedure call a linked server I don't have locally, so, how can I get that change without creating the same linked server?

Answers

  • Options
    To avoid a syntax error you'll probably need to dummy out the linked server. Just give it the same name as the one in production (or wherever) but you can point it to whatever you need to in order for it to work. It doesn't have to be the same server. It just has to have the same name locally.
  • Options
    dccorreadccorrea Posts: 3 New member
    I thought would have another way. Thanks.
  • Options
    In addition to the @Grant's suggestion, if you have just a few linked server hard coded and if you can change the code, you could consider replacing them with synonyms (that point to the linked server objects).
    I know, it's a refactor and it can be potentially massive, but I think that you'll get many advantages.
    just my two cents,

    cheers
    Alessandro Alpi
    CTO @ Engage IT Services s.r.l.
    Database Administrator and Team Leader
    Microsoft MVP - Data Platform
    Staff member of getlatestversion.it community
    personal website | blog
  • Options
    Yeah, that's a very good idea. I'm always hesitant to suggest people to rewrite their code, but this is the way to get it done.
  • Options
    Yes @Grant, I'm totally with you. It's often a stressing-and-heavy work to do, but leaving the code as is leads to code smells sometimes :-).
    [OOT]
    I know that you agree with me (I really hope :-) ) when I say that whether we'd like to be more "DevOps", we should invest some effort in changing small chunks step by step, in order to get a real sandbox in development stage and, in this case too, give value to the customers (quicker releases, more test isolation and automation, and so on).
    [/OOT]
    Alessandro Alpi
    CTO @ Engage IT Services s.r.l.
    Database Administrator and Team Leader
    Microsoft MVP - Data Platform
    Staff member of getlatestversion.it community
    personal website | blog
  • Options
    Absolute agreement. It's the right way to get things done.
  • Options
    dccorreadccorrea Posts: 3 New member
    Using synonyms is the best solution there are many places to change, it would be a hard work right now.
    I used a dummy linked server pointing to localhost because the devs have their local copy, that's why wasn't working.
    Thanks
Sign In or Register to comment.