x

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, 2010 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][1] has some good examples.

[1]: http://www.postgresonline.com/journal/index.php?/archives/103-Using-Microsoft-SQL-Server-to-Update-PostgreSQL-Data.html
more ▼

answered Sep 21, 2010 at 06:17 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.4k 61 65 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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1947
x108
x26
x8

asked: Sep 21, 2010 at 06:07 AM

Seen: 2303 times

Last Updated: Sep 21, 2010 at 06:07 AM