简体   繁体   中英

Create a Linked Server Using a Windows Account in SQL Server

There are multiple applications on SQL Server which I am trying to connect to from a Single SQL Server. Instead of creating multiple SQL User ID we thought of creating a single Windows Service Account and use that to connect to other SQL Servers.

The issue is I dont know if I can configure a Linked Server to take the credentials of a Windows Service account.

Points:

  1. Access has been given to the Windows user account
  2. SQL Servers are on Different domains

Is there a best approach to read from multiple sources within the organization other than linked servers?

Update:

Please find below code I am trying to use to create a Linked Server:

USE [master]
GO

EXEC sp_addlinkedserver     
     @server=N'serverinstance',   
     @srvproduct=N'',  
     @provider=N'SQLNCLI',   
     @datasrc=N'serverinstance.domain.local'; 

GO

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'serverinstance'
                                , @useself = N'TRUE'
                                , @locallogin = N'Domain\NTAccount' 
                              --, @rmtuser = N'user'
                              --, @rmtpassword = N'pass'
GO

The linked server still fails. I do not want to use any SQL Server User Auth.

我认为您需要在两个域之间建立信任关系,并确保防火墙允许您访问链接的服务器。

It can be either.

https://technet.microsoft.com/en-us/library/ms188477(v=sql.105).aspx

Authentication works the same regardless of if you use Sql or NT Domain authentication.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM