IF EXISTS (SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0 AND srv.name = N'ACCESSTEST')
exec sp_dropserver 'ACCESSTEST', 'droplogins'
Go
begin
declare @address nvarchar(max)
set @address= 'E:\\Database\Database.mdb'
exec sp_addlinkedserver 'ACCESSTEST','accesstest','Microsoft.ACE.OLEDB.12.0',@address
exec sp_addlinkedsrvlogin 'ACCESSTEST','false',null,null,null
end
go
/*
select a.*
from [ACCESSTEST]...sRecord a
--EXEC SP_HELPSERVER
*/