linked server Error - sql-server-2005

following error occur when i try to insert record from SQL server 2000 to SQL server 2005, while select query is running fine
OLE DB provider "SQLNCLI" for linked server "insight_db" returned message "Protocol error in TDS stream".
OLE DB provider "SQLNCLI" for linked server "insight_db" returned message "Communication link failure".
Msg 10053, Level 16, State 1, Line 0
TCP Provider: An established connection was aborted by the software in your host machine.

If the insertion is convoluted can you do it with a stored procedure? Minimise the size of the chunk of info passing between DBs. Then check the network traffic: is the link being overwhelmed with competing "stuff" ?

Related

How to use transaction in Linked server

I have a stored procedure which will do the DML operation from SQL query to Oracle DB and unable to use transaction in the Linked server and without the transaction, stored procedure is working as expected.
Server option to “Enable promotion of Distributed Transaction” has already been set to False.
DTC Configuration:
Providers: OraOLEDB.Oracle
Error message:
OLE DB provider "OraOLEDB.Oracle" for linked server "LinkedServer" returned message "Unable to enlist in the transaction.".
The operation could not be performed because OLE DB provider "OraOLEDB.Oracle" for linked server "LinkedServer" was unable to begin a distributed transaction.
All the properties/settings in Linked Server and DTC are followed but still getting the same error. Kindly help here.

Access another SQL Server through stored procedure

I want to access another SQL Server to import and update data of that server's database through a stored procedure.
For that I created linked server using sp_addlinkedserver.
EXEC sp_addlinkedserver
#server = N'LINKEDSERVER'
,#srvproduct=N''
,#provider=N'SQLOLEDB'
,#datasrc=N'[DB-Instance.cuprxxxlj.ap-xxxxxxx-x.rds.amazonaws.com]';
Then try to access by SQL query
SELECT *
FROM [LINKEDSERVER].[DATABASE].[dbo].[TABLE]
And getting errors like
OLE DB provider "SQLNCLI11" for linked server "LINKEDSERVER" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "LINKEDSERVER" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53].
I had created database instance on amazon server and another is also on the amazon server and both are publicly accessible but don't know why I'm getting Server is not found or not accessible. Am I missing any server site setting or something else?
Please guide me if I am going in wrong direction.
I found the answer. The problem was an instance, I had created "Amazon RDS for SQL Server" which is currently not supporting to "Linked servers".
So I create a new AWS EC2 instance for Windows Server 2012 R2 and then I create Linked servers in it and tried to assess remotely. Now its working fine as I wanted.
Here is detailed document to Running SQL Server Linked Servers on AWS
Thanks.
Maybe try changing the timeout settings?
sp_configure 'remote query timeout', 0
go
reconfigure with override
go
This article explains in detail how to link one AWS Sql Server to another (https://aws.amazon.com/blogs/apn/running-sql-server-linked-servers-on-aws/). I am not certain what is wrong in your case, but this has a lot of steps that I do not see in your description.
And the one thing that does jump out at me is that you haven't configured any login security/access control. So unless the target server is open to the world, I would guess that you have to add that as a minimum.

Advantage to SQL 2000 Linked Server Access Denied Error

I am trying to create linked servers in SQL Server 2000 and SQL Server 2005 x64 to a Sybase Advantage database using the Advantage OLE DB Provider, 32-bit and 64-bit respectively.
I kept getting the following error when trying to browse the catalog and when performing a query with openquery from both SQL Servers:
OLE DB error trace [OLE/DB Provider 'Advantage OLE DB Provider' IUnknown::QueryInterface returned 0x80070005: Access denied.].
Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Advantage OLE DB Provider' reported an error. Access denied.
The following Stack Overflow question and answer helped me resolve this problem on SQL Server 2005 x64:
Advantage to SQL 2008 Linked Server Access Denied Error
However, I am still getting the access denied error in SQL Server 2000, despite setting Allow inprocess as suggested above.
Both linked servers use the same data source, login credentials and server options. Any help is greatly appreciated.
Try running a query in the Query Analyzer. You should see the Advantage specific OLE DB errors returned. For example:
Server: Msg 7399, Level 16, State 1,
Line 1 OLE DB provider 'Advantage OLE
DB Provider' reported an error.
[OLE/DB provider returned message:
Error 7078: The Advantage Database
Server cannot authenticate the user.
Make sure the user name and password
are correct. axServerConnect
AdsConnect]
In this case it was a bad user/password

Linked server issue while migrating shards from SQL Server 2005 to 2008 Enterprise R1

I am facing a strange problem during data migration. We "restored" data from 3 shards(on diff SQL Server 2005 machines) to single SQL Server 2008. We have single 2008 server now but the shards are unchanged from 2005.
Now I am trying to exec a SP on Master but I get the following error
Creating SP
OLE DB provider "SQLNCLI10" for linked server "(null)" returned message "Login timeout expired".
OLE DB provider "SQLNCLI10" for linked server "(null)" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53].
All shards are on SQL Server. We are not using SQLNCLI10 provider. But it's strange to see this error.
My SP use some dynamically created distributed queries in SP.
eg. Shard01.dbo.Update.....
What could possible go wrong.
Solved the problem.
My SP was using a view which was moved restored from 2005 to 2008. 2008 has different shards configurations and SQLNCLI10 was used for OPENROWSET in 2005 but not in 2008 as all the DBs were on same server.
Redefining the view solved the issue.

SQL Agent Job failing

I have a BizTalk Server that has been configured per the instructions for BizTalk disaster recovery using the BizTalk Log Shipping implementation.
On the backup SQL Server, call it SQL02, the "Get Backup History" job fails constantly with the following error:
Executed as user: DOMAIN\User. SQL
Server Network Interfaces: Error
getting enabled protocols list from
registry [xFFFFFFFF]. [SQLSTATE 42000]
(Error 65535) OLE DB provider
"SQLNCLI10" for linked server "SQL01"
returned message "Login timeout
expired". [SQLSTATE 01000] (Error
7412) OLE DB provider "SQLNCLI10" for
linked server "SQL01" returned message
"A network-related or
instance-specific error has occurred
while establishing a connection to SQL
Server. Server is not found or not
accessible. Check if instance name is
correct and if SQL Server is
configured to allow remote
connections. For more information see
SQL Server Books Online.". [SQLSTATE
01000] (Error 7412). The step failed.
This job executes a local stored procedure, which basically executes another stored procedure on a linked server, called SQL01.
When i execute this stored procedure in a query window on SQL02:
EXEC [SQL01].[BizTalkMgmtDb_Prod].[dbo].[sp_GetBackupHistory]
it executes without any errors.
When the SQL agent job attempts to execute the same query it fails with the error above.
Why can i execute the procedure manually and the sql agent job cannot?
I had this same problem and solved it by making sure the job runs against a database to which the job owner has access.
check the sql agent and sql instance users it should have the rights and the users should be common for every instance or must have all the required rights.
In query you connect through a user which has the rights but the sql agent user does not have it (as per my understanding).
check your sql server configuration manager for checking users for services of sql server.