Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I rather clueless about this so any help is appreciated.

We have got a stored procedure that is running within a transaction. The stored procedure is called from a .NET program (via normal ADO.NET).

This stored procedure has got the follwing (here simplified) code in it:

DECLARE @sql NVARCHAR(MAX)
SET @sql = N'DELETE FROM ... WHERE ...'
--And now the important part:
EXEC MyLinkedServer...sp_executesql @sql

So it calls sp_executesql on a linked server. Most of the time this query runs fine, however sometimes the EXEC-line fails. The error message is at the end of this post.

I am not quite sure what is happening here. I am not sure if it's EXEC not working within distributed transactions or if maybe EXEC is not running within the "normal" process (whatever that is, just guessing from the error message...).

The motivation behing the EXEC-construct in this case is that we need to delete some entries from a very big table on the linked server and this way it is much faster than just writing:

DELETE FROM MyLinkedServer.DBName.TableName WHERE ...

The error message:

Original: Die Verwendung des OLE DB-Anbieters "SQLNCLI10" mit SQL Server außerhalb des Prozesses with nicht unterstützt.

Google-Translation: The use of OLE DB provider "SQLNCLI10" with SQL Server out of process ist not supported.

share|improve this question
    
Is this being called from a trigger? –  Max Vernon Oct 11 '14 at 6:36
    
@MaxVernon Good point Max, the stored procedure is called from a .NET program (via normal ADO.NET). Will also add this info to the question. –  ManOnAMission Oct 11 '14 at 7:03
    
What is the SQL Server version being used here? And can you post the definition of the linked server (obfuscated user and password, of course)? –  Lmu92 Oct 11 '14 at 13:08
    
Also, could you provide the error code. This way, we can look up the exact English wording of the error. –  Thomas Kejser Oct 12 '14 at 10:49
    
@ManOnAMission - (for troubleshooting) see if it works by running the code within a Query Window on the SQL Server being connected to (where the Linked Server "MyLinkedServer" is defined). This assumes you have access to the SQL Server that the .Net application connects to. If this works, the issue is only from the application. Check out this link: Permissions needed to set up linked server with out-of-process provider –  Simon Oct 13 '14 at 4:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.