<p>I have a SQL Insert query inside a stored proc, for inserting rows into a <strong>linked server</strong> table.</p>

<p>Since the stored proc is getting called within a parent transaction, this Insert statement tries to use a DTC for inserting rows into the linked server.</p>

<p>I would like to <strong>avoid</strong> DTC from getting involved.</p>

<p>Is there any way I can do that (like a hint) for the Insert SQL statement to ignore transactional scope?</p>

[{'answer_id': 76688, 'author': 'AlanR', 'author_id': 7311, 'author_profile': 'https://Stackoverflow.com/users/7311', 'pm_score': 3, 'selected': True, 'text': '<p>My suggestion is that you store whatever you want to insert into a staging table, and once the procedure is over run the cross server insert.  To my knowledge there is no way of ignoring the transaction you are in once you are within the SProc execution.  </p>\n\n<p>In contrast, if you use .NET 2.0\'s System.Transaction namespace, you can tell specific statements not to participate in any parent scope transaction.  This would require you to write some of your logic in code rather than stored procedures, but would work.</p>\n\n<p>Here\'s a <a href="http://decipherinfosys.wordpress.com/2007/02/01/simulating-autonomous-transaction-behavior-in-sql-server/" rel="nofollow noreferrer">relevant link</a>.</p>\n\n<p>Good luck,\nAlan.</p>\n'}, {'answer_id': 49511069, 'author': 'user3675542', 'author_id': 3675542, 'author_profile': 'https://Stackoverflow.com/users/3675542', 'pm_score': 0, 'selected': False, 'text': "<p>Try using openquery to call the linked server query/sp instead of direct calling\nThat worked for me</p>\n\n<p>so instead of\ninsert into ...\nselect * from mylinkedserver.pubs.dbo.authors</p>\n\n<p>e.g.\nDECLARE @TSQL varchar(8000), @VAR char(2)\nSELECT  @VAR = 'CA'\nSELECT  @TSQL = 'SELECT * FROM OPENQUERY(MyLinkedServer,''SELECT * FROM pubs.dbo.authors WHERE state = ''''' + @VAR + ''''''')'</p>\n\n<p>INSERT INTO .....\n      EXEC (@TSQL)</p>\n"}]
['https://Stackoverflow.com/questions/76403', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4337/']