Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
configure_linked_servers
-- Configuring Linked Servers (SQL Server).
USE [master]
GO
-- https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addlinkedserver-transact-sql?view=sql-server-2017
EXEC master.dbo.sp_addlinkedserver
@server = N'PETE-PC',
@srvproduct=N'SQL Server'
-- https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-serveroption-transact-sql?view=sql-server-2017
EXEC master.dbo.sp_serveroption
@server=N'PETE-PC',
@optname=N'connect timeout', @optvalue=N'0'
-- https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addlinkedsrvlogin-transact-sql?view=sql-server-2017
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname = N'PETE-PC',
@locallogin = NULL ,
@useself = N'False',
@rmtuser = N'linked_login',
@rmtpassword = N'epae2!"mdm!'
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.