USE master
GO
-- To use named parameters:
EXEC sp_addlinkedserver
@server = 'SF-PC035',
@srvproduct = '',
@provider = 'SQLNCLI',
@provstr = 'DRIVER={SQL Server};SERVER=SF-PC035\sqlexpress;userid=sa;password="password";'
EXEC sp_addlinkedsrvlogin 'SF-PC035', 'false', NULL, 'sa', 'password'
sp_addlinkedserver is for creating linked server.
sp_addlinkedsrvlogin is for Providing authentication for the linked server.
Then Linked server created sucessfully.
Malleswarareddy
I.T.Analyst
MCITP(70-451)