Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Creating Linked Servers Using Windows Authentication Expand / Collapse
Author
Message
Posted Thursday, April 16, 2009 11:01 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 12, 2012 2:53 AM
Points: 8, Visits: 58
I am using SQL 2005. Now i want to create linked server for another SQL 2005 server using windows authentication.

How to do this. Any help will be more useful.

Thanks,

Manoj
Post #699120
Posted Friday, April 17, 2009 6:55 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, October 16, 2014 5:52 AM
Points: 2,551, Visits: 2,594
Here is the script that I use to create linked servers...

DECLARE @strLinkedServer NVARCHAR(100)

SELECT @strLinkedServer = 'Prod2005Server'

EXECUTE master.dbo.sp_dropserver
@server = @strLinkedServer,
@droplogins = 'droplogins'

EXECUTE master.dbo.sp_addlinkedserver
@strLinkedServer,
'SQL Server'

EXECUTE master.dbo.sp_addlinkedsrvlogin
@rmtsrvname = @strLinkedServer,
@useself = N'False',
@locallogin = N'SomeLocalUser', -- add local login
@rmtuser = N'SomeDomain\SomeWindowsUser', -- add the remote login
@rmtpassword = '****' -- add the remote login password



--Ramesh

Post #699359
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse