Solved

SQL 2008 R2 SP3 install results in OpenQuery errors against local SQL server "Error: Linked servers cannot be used under impersonation without a mapping for the impersonated login"

Posted on 2014-01-29
2
780 Views
Last Modified: 2014-01-31
We installed SP3 and SP3 CU8 on one of our SQL servers.  We have a stored procedure that uses openquery.  It works fine still when accessing data from other location database servers but when it accesses it's own local database(local to the stored proc) using openquery it fails with this error message.

I have seen many recommendations but none seem to apply since I do not have a linked server account for the local server.  I only have linked servers set up for remote servers and the stored procedure is running fine like against those.  Only when it is running against the local data do we get this error.
0
Comment
Question by:NBF
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39820254
without a linked server created pointing to the "local" db I don't think you can get around that error.
0
 

Author Comment

by:NBF
ID: 39823930
We ended up creating a Linked Server called LOCALHOST and tweaked the stored procedures so that when it was pulling data locally using openquery it would instead reference LOCALHOST as the server name in the OPENQUERY.  This worked perfectly.  We were able to implement this ahead of time before installing SP3 in our other environments to avoid any issues.

I am not sure why SP3 caused this but this will work around it.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now