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
Oracle nvarchar2(4000) column wont be imported into SQL Server 2008 R2
I am trying to run this on SQL Server 2008 R2.
SELECT * FROM
OPENQUERY(linked_oracle_server, 'SELECT A.Column1, A.Column2 from A')
This used to work before. We started facing the problem when the A.Column1 was altered to nvarchar2(4000) on the…

Amith Raravi
- 235
- 3
- 18
0
votes
1 answer
IBM db2 is openquery from MS Sql Server a bad thing? Can it be prevented entirely?
I was told by our IT team that we cannot use the Openquery command in MS Sql Server anymore. They claimed it was possible to slow down the server because every query requires a full table load, and all queries slow it down, etc.etc.
I was…

KrisErickson
- 73
- 1
- 10
0
votes
0 answers
SQL server, linked server error with open query
I can't figure out why I am getting this error on the open query line:
"Could not find server 'Server_Name' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the…

Tony
- 133
- 2
- 11
0
votes
2 answers
SQL Linked Server Update Openquery syntax error
I am trying to update data in a PervasiveSQL backend (Sage ERP system) from SQL Server 2008 R2 via a Linked Server setup. Below are details and error msg returned... The kicker is that the update statement works on a development box just fine, very…

user2604613
- 1
- 1
- 1
0
votes
0 answers
Parameterized ADSI queries in Views via OpenQuery on SQL Server 2008
I have a view with one column containing domain\useraccount as an nvarchar(100). I need to convert the value in this column from domain\useraccount to Last, First Middle. I have successfully created a linked server (ADSI), and can resolve a…

AEberhard
- 77
- 4
0
votes
2 answers
calling a remote sproc from a function
I have a stored procedure SprocA resides on ServerA. SprocA takes 4 parameters, executes a dynamic sql and returns a record with 1 column (1 integer value).
I'd like to be able to call this from a function FnB on ServerB so that I can use it in a…

T L
- 504
- 2
- 11
- 27
0
votes
1 answer
passing the desc command to oracle using openquery
I am working on sql server 2005 with a linked server set up to Oracle. I can't get at the underlying account for the link. I need run the
desc
command from SSIS to Oracle. I do have access to openquery. Is there a way to do this? I am…