OPENQUERY is a T-SQL function that allows for executing a pass-through query on a linked server. The linked server should be an OLE DB data source. OPENQUERY is used in SELECT, INSERT, DELETE and UPDATE statements as if it were a table name.
Questions tagged [openquery]
421 questions
0
votes
1 answer
How to use openquery in c#
I have an openquery SQL script:
Select * from openquery([oak],'
SELECT LicenseKey, SUM(PaymentAmount)as Payments
FROM vw_ODBC_actv_Payments pt
WHERE MONTH(pt.EntryDate) = 2 and
YEAR(pt.EntryDate) = 2015
GROUP BY LicenseKey
')
When I run this from…

Zameer Ansari
- 28,977
- 24
- 140
- 219
0
votes
0 answers
Format when passing a date parameter as string to oracle via openquery
I am moving a stored procedure from SQL Server 2005 to SS2008R2. I am using Openquery with date parameters. The 2008 Linked Server is configured with Oracle Provider for OLE DB.
The relevant code looks like this:
DECLARE @beginDate DATETIME
…

emreimer
- 71
- 1
- 1
- 7
0
votes
1 answer
Update OpenQuery with parameters
UPDATE OPENQUERY Help
I am trying to update an Oracle 11 table via a linked server in SQL, now the linked server and select statements all appear correct and I think I am very close to cracking this, but I am having issues with the update. The…

Gordon Barclay
- 13
- 1
- 7
0
votes
0 answers
T-SQL : pass parameter to openquery stored procedure
I am trying to pass a @year parameter through SSRS to a SQL Server stored procedure that queries a Progress database. I am getting a syntax error at the @year value when the stored procedure runs in ssrs.
Can anyone see something blindingly obvious…

user3735855
- 144
- 2
- 20
0
votes
0 answers
SQL Server Linked Server : OLE DB provider 'MSDAORA' reported an error
I have an issues with linked server to Oracle...
at first the server running SQL Servre 2000 and Oracle8i, and the linked server works well...
But after IT Department installs an Oracle 11g Client on the server...
When I execute my open query in SQL…

ajieh89
- 53
- 5
0
votes
2 answers
SQL Server : Openquery to Oracle: Data type for number/numeric
On a SQL Server 2012 SP2 I am using OPENQUERY to Oracle 9/10/11. In general I dealt with integers, now we have some OPENQUERY's which address floating numbers. The values are stored in columns with the data type number(). In SQL Servre the…

Joe Platano
- 586
- 1
- 14
- 27
0
votes
1 answer
Sybase server linked in SSMS using Concatenate in openquery
I have managed to link a Sybase server to SSMS and am able to query it using openquery but I get an error every time I try to concatenate columns. ie:
Select * from openquery(SybaseServer, 'select top 1000 first_name + middle_name + Last_name as…

user3486773
- 1,174
- 3
- 25
- 50
0
votes
1 answer
T-SQL OPENQUERY to MySQL - Insert ID
I am using OPENQUERY to do an insert from MSSQL 2005 to MySQL. How do I get at the last inserted id on the MySQL db back into my MSSQL procedure?

Aditya T
- 147
- 3
- 3
- 14
0
votes
1 answer