openquery Questions

15

Solved

How can I use a parameter inside sql openquery, such as: SELECT * FROM OPENQUERY([NameOfLinkedSERVER], 'SELECT * FROM TABLENAME where field1=@someParameter') T1 INNER JOIN MYSQLSERVER.DATABASE.DB...
Matthaeus asked 31/7, 2010 at 14:26

2

Solved

I use openquery syntax to read the data from a linked server. SELECT * FROM OPENQUERY(LinkServer, 'SELECT * FROM Product') I want to join this link server table with an Sql server table to get ...
Walli asked 5/9, 2012 at 15:48

1

This can be a debatable answer, but I'm looking for the case where a local Excel file needs to be exported to a local SQL Server 2008' table. Has anyone ever had the chance to check execution time...
Hohenstaufen asked 17/8, 2010 at 16:32

7

I am trying to query a MySQL linked server using SQL Server. The below query runs just fine. SELECT * FROM OPENQUERY([Linked_Server], 'SELECT * FROM Table_Name') Is it possible to run the same ...
Concenter asked 12/8, 2015 at 14:37

4

Solved

I have SQL Server 2012 full version installed on my development PC. I am trying to follow the examples here, which show how to create a new temporary table using a stored procedure as the source ...
Harding asked 12/1, 2013 at 13:40

2

Solved

I need to write a procedure to collect data from several remote servers, I use linkedservers and OPENQUERY to gather data from servers, but sometimes I lose connection to some servers or I simply ...
Yonah asked 17/4, 2012 at 12:23

7

Solved

I have SQL Server 2008 with a linked Sybase server and I am trying to execute a stored procedure on the Sybase server using OPENQUERY. If I have a stored proc that doesn't take parameters it succee...
Bosnia asked 11/11, 2010 at 21:31

2

I am running a query using OpenQuery and getting a peculiar error. This is my query: select * from OpenQuery("CAPITAOC",'SELECT per.* FROM pub."re-tenancy" AS t INNER JOIN pub."re-tncy-person"...
Ustulation asked 30/8, 2016 at 11:6

3

I'm working with SQL Server Express, I created a linked server to an Oracle database. As the title indicates, I want to insert data selected from a local table into a table at the Linked Server. ...
Saladin asked 7/1, 2016 at 13:59

1

Solved

I have a Linked Server from SQL Server to my mySQL database (Windows Server using MySQL ODBC Driver 5.3). I have a unique situation where I can only get my longtext columns to return if I convert t...
Roanne asked 4/8, 2018 at 15:15

4

Solved

I have a C# program that uses OPENQUERY() to select from a linked server. This pass-through query takes in a parameter. To guard against SQL injection, I would like to pass this parameter in a mann...
Ghyll asked 19/4, 2018 at 23:1

3

Solved

I need to retrieve data from a linked server using a parameter, @PickedDate for example. The query works fine if I skip @A and @B, but it always returns an error due to a missing single quote. Plea...
Esparto asked 8/5, 2015 at 17:49

3

I have an Oracle 11g XE database that I would like to transfer into SQL Server Express 2005. At first I thought I'd just generate the tables in Oracle as SQL, manipulate the data formats, and run ...
Barrage asked 3/7, 2012 at 11:15

6

I've searched everywhere for this situation and can't find a solution except for Dynamic SQL, which I don't want to use. Here is the table I want to UPDATE on server 2: (Stuff Id UNIQUEIDENTIFIER...
Thilde asked 3/7, 2015 at 17:49

2

Solved

I had a query with a set of parameters that needed to be run multiple times with different parameters, so I wrapped it in a table-valued function. That table valued function needed called from a r...

2

I've tried this code and still got the following error, perhaps anyone could help? UPDATE a SET a.MMDWNO = '21' FROM OPENQUERY(NMIIFLIB, 'select * from MVXCDTANSN.MITMAS WHERE MMITTY = ''25''')...
Azine asked 8/2, 2013 at 5:52

1

Solved

I have a linked server Remoteserver containing a table that holds file and folder names from a dir When I am on the remote server I can run a built in procedure (xp_dirtree) and populate the 'file...
Disprove asked 9/1, 2015 at 5:28

2

I am trying to insert records into MySQL database from a MS SQL Server using the "OPENQUERY" but what I am trying to do is ignore the duplicate keys messages. so when the query run into a duplicate...
Toast asked 19/1, 2014 at 18:23

3

Solved

I'm writing a script that is supposed to run around a bunch of servers and select a bunch of data out of them, including the local server. The SQL needed to SELECT the data I need is pretty complic...
Neville asked 3/3, 2010 at 20:37

2

I have a Linked Server from SQL Server 2008 R2, to a DB2 Database (V4R5M0) using OLE DB provider "IBMDA400" Linked Server Detials EXEC master.dbo.sp_addlinkedserver @server = N'JTEST', @srvprod...
Dollydolman asked 31/5, 2013 at 13:21

4

Solved

I've got this query UPDATE linkeddb...table SET field1 = 'Y' WHERE column1 = '1234' This takes 23 seconds to select and update one row But if I use openquery (which I don't want to) then it on...
Hindquarter asked 18/11, 2010 at 11:16
1

© 2022 - 2024 — McMap. All rights reserved.