Questions tagged [openquery]

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.

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…
M.Ford
  • 369
  • 1
  • 4
  • 15
0
votes
0 answers

query templates while Linked Servers handling

In order to make single interface for app getting data from different datasources I created one stored procedure where I try to keep all data access/handling routines. Current situation: Sql Server sp receives fixed number of parameters and should…
revoua
  • 2,044
  • 1
  • 21
  • 28
0
votes
1 answer

OpenQuery into a local table

I have a very simple script. The purpose is to pull data from a linked server into a table in another database DECLARE @SQLString VARCHAR(2000) SET @SQLString = 'SELECT * from OPENQUERY(MyLinkedServer, ''SELECT ... ... FROM…
Jeff
  • 2,283
  • 9
  • 32
  • 50
0
votes
1 answer

Sybase openqueries?

Does open query exist in sybase ? Or more generally, in sybase, what are the possible way to select among the result of a procedure (temporary tables, out params, others ??)
Toto
  • 7,491
  • 18
  • 50
  • 72
0
votes
1 answer

SQL Openquery Dynamic Parameter

I am trying to include a parameter in T-SQL's Openquery function. I have done this successfully in the past, but my current code is not cooperating: declare @bom smalldatetime declare @eff_date smalldatetime set @eff_date = (select min(postdate)…
0
votes
1 answer

openquery: datum formatting

I'm trying to retrieve data from Oracle by SQL server so I'm using openquery and I'm able to get date interval this way: SELECT * FROM OPENQUERY(DATABASE, 'SELECT * FROM ORACLE.TABLE WHERE CREATEDATE between {d ''2013-03-23''} and {d…
gaffcz
  • 3,469
  • 14
  • 68
  • 108
0
votes
1 answer

SQL Server - Oracle Linked Server with join

Hare is the scenario: Main DB Server: SQL Server 2008 R2 with a Linked Server to Oracle 11g. I have a Stored Procedure that make a query like: Select t1.a, t1.b, t2.c, t3.d From LocalTable a inner join LinkedServerName..Schema.Tableb b on a.aNumber=…
HiperiX
  • 395
  • 5
  • 19
0
votes
1 answer

Insert Into a Table Across Linked Server From SP Using Openquery

I want to send data across from one server to another, I wish to improve my performance and wondered if OpenQuery is a good route to go down? I tried to do something like this; INSERT INTO OPENQUERY (SERVERNAME, '(SELECT Num1, Num2, Num3 FROM…
William
  • 6,332
  • 8
  • 38
  • 57
0
votes
1 answer

SQL Server Linked Server to Progress is slow with an openquery view

We have a SQL Server database setup with a Linked Server setup connecting to a Progress OpenEdge database. We created a SQL Server view (for using with SSRS) of some of the OpenEdge tables using code similar to the following: CREATE VIEW accounts AS…
CodeHulk
  • 111
  • 1
  • 12
1 2 3
27
28