--ODBC üzerinde SysytemDSN üzerinde PostgreSQL driver tanimliyorsun. Sonrasında SQL mamangement studio da Provider alanina ---Microsoft OLE DB Provider for ODBC Drivers seciyorsun. Data source bosluguna -- odbc uzerinde tanimladigin filesystemDSN ismini yaziyorsun. Security tabda: Be made without using a security context secili. USE [master] GO
/****** Object: LinkedServer [POSTGRESQL] Script Date: 3.9.2018 12:00:18 ******/ EXEC master.dbo.sp_addlinkedserver @server = N'POSTGRESQL', @srvproduct=N'POSTGRES', @provider=N'MSDASQL', @datasrc=N'erpist', @catalog=N'PostgresLink' /* For security reasons the linked server remote logins password is changed with ######## */ EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'POSTGRESQL',@useself=N'False',@locallogin=NULL,@rmtuser=N'postgres',@rmtpassword='########'
GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'collation compatible', @optvalue=N'false' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'data access', @optvalue=N'true' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'dist', @optvalue=N'false' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'pub', @optvalue=N'false' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'rpc', @optvalue=N'true' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'rpc out', @optvalue=N'true' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'sub', @optvalue=N'false' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'connect timeout', @optvalue=N'0' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'collation name', @optvalue=null GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'lazy schema validation', @optvalue=N'false' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'query timeout', @optvalue=N'0' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'use remote collation', @optvalue=N'true' GO
EXEC master.dbo.sp_serveroption @server=N'POSTGRESQL', @optname=N'remote proc transaction promotion', @optvalue=N'true' GO