Entity Framework 6 Forces Distributed Transaction

0

I need to run custom sql script during the Entity Framework migration. Script:

exec sp_executesql N'create view VIEW_TS_Shops as select * from openquery([TS-SQL], ''select * from Shops'')'

Migration fails with error message:

System.Data.SqlClient.SqlException (0x80131904): The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "TS-SQL" was unable to begin a distributed transaction. OLE DB provider "SQLNCLI10" for linked server "TS-SQL" returned message "The partner transaction manager has disabled its support for remote/network transactions."

My attempts to solve the problem are listed below.

  1. Use an argument "suppressTransaction:true" when calling Sql() method.
  2. Disabling promotion of ditributed transaction in properties of linked server.

No result. How can I fix it?

UPDATE

My solution with argument "suppressTransaction" is working, but I forgot to specify it for all SQL instructions that operate on the view.

sql-server
entity-framework
asked on Stack Overflow Mar 22, 2019 by Interloper • edited Mar 25, 2019 by Interloper

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0