home
Add a self linked server
Author Nigel Rivett
This is useful for testing remote queries and creating a temp table from a stored procedure call.
Note - a self linked server does not act the same as a remote server.
integrated security
EXEC sp_addlinkedserver
@server = 'self',
@srvproduct = '',
@provider = 'MSDASQL',
@datasrc = NULL,
@location = NULL,
@provstr = 'DRIVER={SQL Server};Server=(local); Initial Catalog=master;Integrated Security=SSPI;'
sql server security
EXEC sp_addlinkedserver
@server = 'self',
@srvproduct = '',
@provider = 'MSDASQL',
@datasrc = NULL,
@location = NULL,
@provstr = 'DRIVER={SQL Server};Server=(local); Initial Catalog=master;uid=sa;pwd=mypwd;'
home