- Forum
- Main PGNP Forum
- SQL Server/DTS/SSIS/Linked servers/Replication
- Querying a PostGres View from SQL Server
Querying a PostGres View from SQL Server
- mradams
- Topic Author
- Visitor
-
8 years 7 months ago #11160
by mradams
Querying a PostGres View from SQL Server was created by mradams
I have created three views on my company's postgres server that I would like to query using the OLEDB adapter from SQL Server via linked server. I tried using an OPENQUERY statement to reference the view, but I get an undefined table message. (see below)
SELECT *
FROM OPENQUERY (BSI,'SELECT * FROM public."BSI_AccountContainer"')
Can someone help with my syntax to see if that is an issue?
SELECT *
FROM OPENQUERY (BSI,'SELECT * FROM public."BSI_AccountContainer"')
Can someone help with my syntax to see if that is an issue?
Please Log in or Create an account to join the conversation.
8 years 7 months ago #11161
by Moderator
Replied by Moderator on topic Re: Querying a PostGres View from SQL Server
We were unable to reproduce the issue. Could you upgrade to the latest version, and see if you can reproduce the issue?
If the issue is still reproducible with the latest build, could you e-mail detailed steps to our Support address?
Thank you
If the issue is still reproducible with the latest build, could you e-mail detailed steps to our Support address?
Thank you
Please Log in or Create an account to join the conversation.
- mradams
- Topic Author
- Visitor
-
8 years 7 months ago #11163
by mradams
Replied by mradams on topic Re: Querying a PostGres View from SQL Server
Actually, I found out what I was doing wrong...it appears the provider utilizes views just like tables when referencing them via linked server.
By using this sort of syntax, I am able to pull the data from the views with no issue:
SELECT *
FROM "BSI"."production"."public"."BSI_AccountContainer"
Thanks
By using this sort of syntax, I am able to pull the data from the views with no issue:
SELECT *
FROM "BSI"."production"."public"."BSI_AccountContainer"
Thanks
Please Log in or Create an account to join the conversation.
- Forum
- Main PGNP Forum
- SQL Server/DTS/SSIS/Linked servers/Replication
- Querying a PostGres View from SQL Server
Time to create page: 0.048 seconds
- You are here:
-
Home
-
Forum
-
Main PGNP Forum
-
SQL Server/DTS/SSIS/Linked servers/Replication
- Querying a PostGres View from SQL Server