0

I am trying to query across servers.

The error message I got was:

Access to the remote server is denied because no login-mapping exists.

I found this SO post:

Stackoverflow Post #1

Microsoft Documentation

I am having trouble setting this up though:

Let's say I have the following parameters:

user login = 'john.doe'
server = 'abc'
instance = '123'
schema: 'dbo'
database: 'restaurant_menu'

sql server version = '2016'

I am not sure how to set this up. This is what I came up with so far. Also, this is just a one-time query that may get ran up to a couple more times, but that is it.

EXEC master.dbo.sp_addlinkedserver 
@server = N'abc',
@provider = N'SQLNCLI',
@srvproduct = 
@datasrc = 
@location = -- I don't think I need to fill this part out
@provstr =
@catalog =
  • 1
    If it's a one-time query with a fixed (SQL) login, consider using `OPENROWSET` instead of a permanent linked server. (This needs to be enabled with `sp_configure` first, but can be disabled afterwards.) – Jeroen Mostert Sep 13 '18 at 14:54
  • This is a useful comment because I had no idea openrowset was even a thing. I looked at the documentation and it does appear that is the way to go. I still need to figure out how to set this up, but thank you for your comment. – Chicken Sandwich No Pickles Sep 13 '18 at 14:58
  • I figured it out using openrowset, sadly this is blocked using some security feature that I was not aware of. Thank you for the help though! – Chicken Sandwich No Pickles Sep 13 '18 at 15:03

0 Answers0