Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linked server security problems

Posted on 2008-10-02
6
Medium Priority
?
272 Views
Last Modified: 2012-05-05
Hi

I have a SProc that is set to run on Server - it calls and makes some changes to remote DB on another server.
I have created a SQL user account with basic priveleges and used it to set up a linked server connection between the 2 servers.
The account is called 'LinkedUser' for example.

The account has basic priveleges to the databases it needs to run against.

I am trying to call the SProc from a SQL Agent job.
But when I try and run the job get error message
"Access to the remote server is denied because no login-mapping exists. "

The job is set to run as SA..

How can I get around this ?

0
Comment
Question by:mooriginal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 22630547
0
 

Author Comment

by:mooriginal
ID: 22632338
thanks i hadnt seen that - but it didnt help
its not helped
1.i dont use client OLE
2. also tried the option that the remote login i use for the connection is also a remote login on the target server...

If I could get SQL Agent to run the job as linkedsvruser [ my login ive created to make the linked connection] then it fix my problem
But when I try to add the SQL login Linkedsvruser - from the job properties I cant see this login to add it - ive given this login now SYSADMIN rights on the server to see if would show up in the list but it still doesnt

my connection string
/****** Object:  LinkedServer [CALLIOPE]    Script Date: 10/03/2008 10:45:08 ******/
EXEC master.dbo.sp_addlinkedserver @server = N'CALLIOPE', @srvproduct=N'SQL Server'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'collation compatible', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'data access', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'dist', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'pub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'rpc', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'rpc out', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'sub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'connect timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'collation name', @optvalue=null
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'lazy schema validation', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'CALLIOPE', @optname=N'query timeout', @optvalue=N'0'
GO
EXEC master.dbo

Open in new window

0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22633233
Ok...let me ask you thin.  when you created the linked server, did you do so through the interface (SSMS) or did you do it through a stored procedure?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mooriginal
ID: 22633896
erm interface

I picked SQL server - gave it that server name
then picked security - local login - remote user
made sure that both these accounts matched and existed on both source and target servers

for login not definded in above list - said connections will Not Be Made.
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 1000 total points
ID: 22633973
0
 

Author Comment

by:mooriginal
ID: 22659634
I have made sure that the 'test' login is valid sql login on Source server and the Target server [MINOS\SQL200564].

I have added the linked server using the following below.

I then open a query connection using sa account and try and run this :
select * from TEST_LINK.DBA.dbo.checkedout_mabel

I get error:
Login failed for user 'sa'.
OLE DB provider "SQLNCLI" for linked server "TEST_LINK" returned message "Invalid connection string attribute".



EXEC sp_addlinkedserver
@server = 'TEST_LINK',
@srvproduct = '',
@provider = 'SQLOLEDB',
@provstr = 'DRIVER={SQL Server};SERVER=MINOS\SQL200564;UID=test;PWD=password;'

Open in new window

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

719 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