1,498 questions
0
votes
1
answer
85
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
1
answer
182
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 ...
-1
votes
1
answer
652
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 ...
0
votes
1
answer
67
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 ...
-1
votes
1
answer
306
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
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
31
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
0
answers
59
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
1
answer
135
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;
...
1
vote
0
answers
231
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 ...
1
vote
0
answers
89
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 ...
0
votes
1
answer
75
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
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
35
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
2
answers
169
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 ...
1
vote
0
answers
187
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
0
answers
100
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
2
answers
110
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&...
0
votes
2
answers
869
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
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 ...
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
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
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
1
answer
406
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, ...
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, ...