x
login about faq Site discussion (meta-askssc)

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)

more ▼

asked Sep 21 '10 at 06:07 AM in Default

Simonn gravatar image

Simonn
33 2 2 3

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

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 has some good examples.

more ▼

answered Sep 21 '10 at 06:17 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.2k 56 63 87

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1835
x92
x26
x6

asked: Sep 21 '10 at 06:07 AM

Seen: 1475 times

Last Updated: Sep 21 '10 at 06:07 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.