1,498 questions
0
votes
1
answer
97
views
Why OPENQUERY fails with multiple CTEs with a where clause in some cases but not others
I have a query that contains two CTEs, one based on a linked Oracle server (from a SQL Server) that fails. I can fix it by doing any of the following: add a select limit (e.g. TOP 1000) to the SELECT ...
0
votes
0
answers
144
views
Saved Remote Password on a SQL Server Linked Server Becomes Invalid After a Server Restart
I have a SQL Server instance on AWS RDS with a Linked Server newly set up for replicating records from one database to another. This is working as expected. Today, the database was bounced as part of ...
0
votes
1
answer
190
views
How do I get a list of stored procedures from a linked server?
I am trying to do a backup of all stored procedures and tables from one database server to another. I want to get a list of stored procedures and tables that exist in the destination database so I can ...
0
votes
1
answer
198
views
Possible ways of updating the catalog of an already created Linked server
Reason for change
I have a main Staging server with multiple linked server's setup.
Each one of these Linked Servers have their own DB on the main Staging Server.
I have an SP that extracts data from ...
-1
votes
1
answer
734
views
Cannot get Linked Servers to work with MS SQL Server developer edition
This may seem like an overly verbose post but I appreciate being given all the details when asked a question, so I am doing the same thing here:
I have a situation where I'm running SQL Server Dev ...
-2
votes
1
answer
76
views
Getting SQL Server version of linked server
I have many linked servers in my SQL Server.
A need has arisen that getting SQL Server version of these linked servers in a script.
I find following command that return SQL Server version of current ...
0
votes
1
answer
68
views
Reference Linked Server in LocalDB stored procedure [duplicate]
I am writing a system that reads from a remote server and read/write to a local server. I am at the point where I now have to query data from both the remote server and my local server together (for ...
0
votes
1
answer
58
views
Use MySQL linked server with dynamic db name
I have a table category, which exists in both test and prod db. Whenever I have to get data from MySQL I have to write test or prod in db like below, as openquery doesn't support dynamic query.
SELECT ...
-1
votes
1
answer
319
views
Running Remote Function with Parameters in Linked Server
I have a SQL function that adds a number of business days into a specific date.
The function is running ok in the local database server.
However I'm having problem running the function from linked ...
0
votes
1
answer
76
views
Slow linked server (SQL Server to Oracle)
I need to move data from an Oracle database to SQL Server.
If I run this very simple directly on the database, I get my results in < 1 second (returns 30K out of 250m rows):
select *
From my_table ...
0
votes
1
answer
163
views
Error copying data from SQL Server to Redshift via a linked server connection
We have local SQL Server data that we would like to sync to Redshift nightly. I can write individual values to the Redshift server, but can not can do a standard insert of data from a local table
...
0
votes
1
answer
159
views
Linkedserver connection to MySQL database with ODBC driver connection issue
I have setup SQL Server 2016 linkedserver to connect to MySQL 8 instance and created stored procedure that insert data from SQL Server database to MySQL database using open query, it works fine when I ...
0
votes
1
answer
38
views
Configure an INSERT INTO query with multiple UNIONs across multiple databases and multiple servers
I have seen examples of INSERT queries that pull date from tables in multiple databases or multiple servers but I have not been successful in putting all of it together.
I have a query that uses ...
0
votes
1
answer
142
views
STUFF XML with openquery is matching on values that should've been filtered out in the where clause?
I typically use STUFF and XML to concatenate multiple values where I'm expecting one distinct row, e.g.
Category
Product
Fruit
Apple
Food
Apple
select distinct
t1.Product
, Categories = STUFF((
...
0
votes
0
answers
61
views
Configuring SSRS to Use Conditional Linked Server Connections Based on User Data
Let me explain my situation:
Server A: This is my SSRS (SQL Server Reporting Services) server, which hosts all users and source connections.
SQL Server B: This server is used for query connections ...
0
votes
0
answers
47
views
Data flow from Oracle to SQL Server using open query
I have a table in oracle server and I am trying to move the data in a SQL table, I created a linked server which works fine, when I try to move the data by specifying the where clause, it does not ...
0
votes
1
answer
136
views
Same insert statement on linked server, different behaviours
I have an insert statement basically something like this:
insert into openquery(Test_LinkedServer,
'select a,b,c from my_ora_table')
select a, b, c
from my_dbo_table;
...
0
votes
1
answer
256
views
How do I solve a "linked-server error" when using execute(@sql) at [linked_server] when the server is already registered?
I have a requirement to link to an Oracle server in the cloud through a linked server in Sql Server.
I have created a stored procedure to execute a generic PL/SQL script that returns an IEnumerable<...
1
vote
0
answers
236
views
Can OAuth be used with SQL Linked Server (SF ODBC driver) for Authorization to Snowflake instead of username/password?
I see that with snowflake ODBC driver you can specify the authenticator as oauth and provide token for authZ. But I am trying to figure out when using the ODBC driver from snowflake for SQL linked ...
0
votes
1
answer
341
views
Pass a dynamic date variable into MySQL linked server OPENQUERY
I am using SQL Server v18.10, and try to create a variable for dynamic date and pass it into linked server OPENQUERY. I able to display the date result in SQL but not in linked server.
I followed the ...
1
vote
0
answers
93
views
Cross database reference in Visual Studio DACPAC solution
I'm trying to update a target server using the Schema Compare feature in Visual Studio 2019. Upon checking the sys.servers table, I can see the linked server and confirmed that I can run queries ...
3
votes
1
answer
4k
views
Work around >8000 character limit on OPENQUERY SQL statement inside a VIEW
My team has read-only access to a remote PostgreSQL database - which we query remotely from our local SQL Server instance using a linked server connection. We cannot modify the remote Server's ...
0
votes
1
answer
80
views
Cosmos DB - Can't see third level nested JSON data in ODBC Schema Editor
I'm working on a project where I need to connect to a Cosmos DB using a Linked Server connection in SSMS. As I make the connection, I need to use the ODBC Schema Editor to map the data. Within the ...
0
votes
0
answers
126
views
How to schedule SQL stored procedure of a Snowflake linked server
I have a snowflake DB that I want to copy into a SQL Server database.
The .NET connector in C# is too slow to work with so I thought about schedule a stored procedure that will copy a part of the ...
0
votes
0
answers
163
views
SQL Server MERGE statement executed at Azure DB with linked server
I have set up a linked server connection from my on-premise to Azure called AZURE. When I run the following code, it errors out:
DECLARE @DynamicSQL NVARCHAR(MAX)='
MERGE [AZURE].[Test].[dbo].[...
0
votes
0
answers
64
views
Update to a NOTE() column fails through Linked_Server, but works in ZCC
Question summarized:
How do I get Pervasive SQL 15.2 as a Linked Server into SQL Server 2022 like we did with 9.7 into 2000?
Background and details:
We have an ERP system that's using a Btrieve ...
0
votes
0
answers
36
views
.NET Core Linked Server SQL not recognized
I am having an issue troubleshooting what is wrong with this linked server that I set up in SQL.
This is what my setup looks like in SSMS
I am able to query things successfully inside SSMS like this
...
0
votes
1
answer
409
views
Update trigger for SQL Server linked server
Update trigger doesn't work while using SQL Server linked server.
I created a linked server on my local SQL Server. I can query this linked server (SELECT, UPDATE, INSERT etc.) from my local machine.
...
0
votes
2
answers
181
views
Pulling data from a linked SQL Server using DPLYR
I am trying to use dplyr to pull data from a table on a linked SQL Server. I am able to connect and run queries using the dbGetQuery method as long as I (1) provide the fully qualified path ([server ...
0
votes
0
answers
513
views
SQL Server linked Server to MySQL MSDASQL inconsistent metadata
We had SQL Server 2012 and MySQL Server 8.0.35 on ubuntu. We migrated the SQL Server to 2022 (Windows Server 2022). MySQL server still the same.
Now when I use linked Server with the MySQL server most ...
1
vote
0
answers
189
views
SQL Server returns error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'." in SQL Server logs
Our SQL Server 2019 (Server A) is configured to use linked servers with SQL Server 2019 (Server B). Kerberos Authentication is enabled and SPNs are configured correctly. All the accounts needed are ...
0
votes
1
answer
207
views
Error connecting from SQL Server 2016 to Filemaker odbc
I created a linkedserver from SQL Server 2016 to Filemaker database on another server. ODBC driver version in 19.xx.
Using the ODBC driver and DSN, I can see the data from the Filemaker database using ...
0
votes
0
answers
102
views
SSMS Linked Server from PostgreSQL query fails when adding WHERE clause
I have Linked server from PostgreSQL 12 to my SSMS and trying to join two PostgreSQL tables and insert the result to my table with the stored procedure.
The problem I have is when adding a WHERE ...
0
votes
1
answer
339
views
Table refresh from Azure SQL database to on-premise SQL Server database
I have a similar requirement but the other way. I.e I have a table in an Azure SQL database, which we need to copy data from the Azure SQL database to an on-premise SQL Server database. The table ...
0
votes
2
answers
112
views
Azure SQL linked servers with VPN to DB2
I have a Azure SQL online SQL-database. How can I create a linked server to a DB2 server with a VPN (Fortigate).
I have checked some tutorials, but my SSMS does not have a folder "linked Servers&...
1
vote
1
answer
152
views
Linked Server to Synapse Spark Tables: Queries hang if join on a STRING column is present
Setup:
AzureVM. Azure VM running SQL Server 2022
LS_CSV: Linked Server to Synapse SQL Endpoint database, which itself has Views to CSV files in Spark
LS_Delta: Linked Server to Synapse SQL Endpoint ...
0
votes
2
answers
884
views
Can I change a linked server connection, but keep the name the same?
On my SQL Server instance, I have about 30-40 stored procedures.
In those stored procedures, sometimes I call a table from a linked server something like.
Select *
From Picktickets P
Left Join [JMNYC-...
0
votes
0
answers
78
views
sp_testlinkedserver kills transaction
I am trying to validate if my linked server is up:
CREATE PROCEDURE [dbo].[GET_Validate_LinkedServer]
@LinkedServer NVARCHAR(50),
@Status BIT = NULL OUTPUT
AS
BEGIN
SET NOCOUNT ON;
...
0
votes
1
answer
184
views
Creating linked server between DWH and Azure
How do I create a linked server between DWH SQL Server (which is in a service providers environment) and MS Azure.
What type of settings must I make sure is on Azure and what is the string that I ...
0
votes
0
answers
67
views
SQL Server Linked Server is getting an old view definition
I have a linked server that I am able to run views on. I have one view in particular that when I run it, the wrong data is returned. When I run sp_helptext on the view to get the definition, the ...
1
vote
1
answer
1k
views
Linked Server on SQL Server Managed Instance
I have SQL Server Managed Instance. Now I want to get data from on-premises SQL Server to SQL Server Managed instance through linked server on a daily basis.
The on-premises SQL Server has only ...
0
votes
1
answer
89
views
Can't insert into linked MySQL server
I want to insert a new rows into database in MySQL server from SQL Server Management Studio. To make it possible I've created a linked server in SMSS with this guide: https://www.sqlshack.com/how-to-...
0
votes
0
answers
126
views
Union All of one linked server in a With clause of query of one linked server
In a stored procedure, I have a few With clauses, of a query executed at linked server A:
DECLARE @myQuery VARCHAR(MAX)
SET @myQuery = 'SELECT * FROM (WITH
A AS (Select ... from ...),
B AS (...
0
votes
0
answers
119
views
Can i set SSAS multidimensional model data source a database in a SQL Server linked server?
I have a SQL Server linked server called [HJNSDATAENG.DW]. I have created a SSAS multidimensional project called rh_dw.
I want to set as my SSAS project's data source the database [warehouse] located ...
0
votes
1
answer
1k
views
SQL Server: Use a CSV as a linked server
I need some help in configuring an SQL Server csv linked server. I already have an Excel linked server working without any problems, but each time I try to connect to my csv, I get varying error ...
0
votes
0
answers
3k
views
SQL Server login failed on linked server
In my SQL Server version 15.0.4312.2, I linked another SQL Server same version. The servers are in the same Active Directory Domain.
Unfortunately, I get a lot of errors because apparently one server ...
0
votes
1
answer
409
views
An error occurred while preparing the query
An error occurred while preparing the query
SELECT SUBSTRING(UGB,1,9) as EntityCode, SUBSTRING(FUNCIONARIO/CREDOR DESCONTADO,1,9) as NRCId, SUBSTRING(FUNCIONARIO/CREDOR DESCONTADO,11,75) as CustName, ...
0
votes
2
answers
376
views
How can I execute a SQL script when the linked server connects successfully?
How to execute SQL script when the linked server connects success.
this script from other website.
but i didn't know how to insert query below the script when connection success.
----------------------...
1
vote
0
answers
123
views
SQL Server stored procedure accessing Oracle runs in Management Studio but not in Delphi client via ADO
We have a stored procedure running on SQL Server that exchanges data with an Oracle table, through a linked server, the versions of both products are at the end of this post.
In our stored procedure, ...
0
votes
1
answer
74
views
Iterate through list of linkservers while trying to execute SQL query as EXECUTE (@SQL) at [LinkServer]
I am trying to execute the below -
DECLARE @SQL nvarchar(max), @LinkServer nvarchar(200), @min INT=1, @max INT
drop table if exists #clients;
create table #clients (Id int identity(1,1), ClientName ...