Is there any way to see if any of my users have accessed a linked server?

  • SQL Friends,
    We have a linked server we are looking to retire, but we cannot tell if it is being accessed by anyone or any process?
    Does anyone know a way to tell?
    Thanks,
    Ozzie

  • Douglas Osborne-229812 - Tuesday, May 22, 2018 12:13 PM

    SQL Friends,
    We have a linked server we are looking to retire, but we cannot tell if it is being accessed by anyone or any process?
    Does anyone know a way to tell?
    Thanks,
    Ozzie

    Reliably and after the fact no. You can search the plan cache but that isn't guaranteed and likely won't have something that hasn't been used recently. You could set up an extended events session looking for any statements calling the name of the linked server but depending on the name, it could be a nightmare. And those often need to run for quite a bit to cover things like some yearly processing or something along those lines. Even if you could search all source code and such, it could be used by one person for some ad hoc query they need to run occasionally.
    There are so many ways to get bitten when retiring/removing database objects. However you retire it, I would want to have a script to recreate the linked server if needed. That's often the best you can do with those.

    Sue

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply