Sql Server MS Access
DECLARE @AccessFileName nvarchar(32); DECLARE @FilePath nvarchar(max); DECLARE @CombinedPath nvarchar(max); SET @AccessFileName = N'MA.accdb'; SET @FilePath = N'D:\MA\'; SET @CombinedPath = @FilePath + @AccessFileName; IF EXISTS ( SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0 AND srv.name = N'MA_AccessDB' ) BEGIN EXEC master.dbo.sp_dropserver @server=N'MA_AccessDB', @droplogins='droplogins' END EXEC master.dbo.sp_addlinkedserver @server = N'MA_AccessDB', @provider = N'Microsoft.ACE.OLEDB.12.0', @srvproduct = N'Access2007', @datasrc=@CombinedPath EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'MyAccessDB', @locallogin = N'SQL_Kullanici_Adi', ...