Note that there are some explanatory texts on larger screens.

plurals
  1. POMsdtc Transaction
    text
    copied!<p>I am using Linked server for Transaction<br> example</p> <pre><code>Alter Proc [dbo].[usp_Select_TransferingDatasFromServerCheckingforExample] @RserverName varchar(100), ----- Server Name @RUserid Varchar(100), ----- server user id @RPass Varchar(100), ----- Server Password @DbName varchar(100) ----- Server database As Set nocount on Set Xact_abort on Declare @user varchar(100) Declare @userID varchar(100) Declare @Db Varchar(100) Declare @Lserver varchar(100) Select @Lserver = @@servername Select @userID = suser_name() Select @User=user Exec('if exists(Select 1 From [Master].[' + @user + '].[sysservers] where srvname = ''' + @RserverName + ''') begin Exec sp_droplinkedsrvlogin ''' + @RserverName + ''',''' + @userID + ''' exec sp_dropserver ''' + @RserverName + ''' end ') Set @RserverName='['+@RserverName+']' BEGIN TRY BEGIN TRANSACTION Declare @ColumnList varchar(max) Set @ColumnList = null Select @ColumnList = case when @ColumnList is not null then @ColumnList + ',' + quotename(name) else quotename(name) end from syscolumns where id = object_id('bditm') order by colid Set identity_insert Bditm on Exec ('Insert Into Bditm ('+ @ColumnList +') Select * From '+ @RserverName + '.'+ @DbName + '.'+ @user + '.Bditm') Set identity_insert Bditm off Commit Select 1 End try Begin catch If (@@ERROR &lt;&gt; 0) Begin If @@trancount &gt;0 Begin Rollback transaction Select 0 END End End Catch Set @RserverName=replace(replace(@RserverName,'[',''),']','') Exec sp_droplinkedsrvlogin @RserverName,@userID Exec sp_dropserver @RserverName </code></pre> <p>this is the Error occured:<br> The Microsoft Distributed Transaction Coordinator (MS DTC) has canceled the distributed transaction.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload