0

I'm trying to select from a few tables in different servers using SQL Server 2008. This is the script I'm using:

exec sp_addlinkedserver @server = '192.168.5.208'
select * from [192.168.5.208].[hrm2].[dbo].tb_mt_pim

but it doesn't work. It returns a message

'Login failed. The login is from an untrusted domain and cannot be used with windows authentication'

Can someone tell me why?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
dapidmini
  • 1,490
  • 2
  • 23
  • 46
  • 1
    you need to add authentication, (login details for you server) – lemunk Sep 04 '13 at 09:20
  • how? I don't see where I can add the authentication in sp_addlinkedserver from this link http://msdn.microsoft.com/en-us/library/ms190479.aspx I also tried replacing the `exec sp_addlinkedserver @server = '192.168.5.208'` with `EXEC sp_addlinkedsrvlogin '192.168.5.208', 'false', NULL, 'sa', 'Actsstsj4547'` but the error message stays the same – dapidmini Sep 04 '13 at 09:28

1 Answers1

0

Seems you not adding Authentication.

try:

EXEC sp_addlinkedsrvlogin
@useself='FALSE',
@rmtsrvname='TEST_LINK',
@rmtuser='user',
@rmtpassword='secret'

Obviously edit the strings to your credentials and execute, should be able to connect then.

lemunk
  • 2,616
  • 12
  • 57
  • 87