question

Simonn avatar image
Simonn asked

Linked Postgres Server ON MS SQL 2005

Hi All I have a linked server configured for a Postgres server on my MS SQL 2005 server. I use this server quite often to receive data for queries and reports but the server response is to slow and need an alternative solution. The ODBC provider I'm using is PGNP on the linked server. I thought of using openrowset so I could only return the data I need but not sure how to specify the IP Address, Port number, username or password. Please could anyone help. To query the linked server currently I use SELECT * FROM [LinkedServer].[DatabaseName].[Public].[tablename] WHERE (Statement)
sql-server-2005linked-serveropenquerypostgresql
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Matt Whitfield avatar image
Matt Whitfield answered
You would use something along these lines: SELECT * FROM OPENROWSET('ProviderName', 'ConnectionString', 'SELECT * FROM [DatabaseName].[Public].[tablename] WHERE (Statement)') You then would need to substitute ProviderName and ConnectionString with the relevant details for your PostGres client. I am not sure what they are though. However, [this page][1] has some good examples. [1]: http://www.postgresonline.com/journal/index.php?/archives/103-Using-Microsoft-SQL-Server-to-Update-PostgreSQL-Data.html
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.