Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





BEGIN DISTRIBUTED TRANSACTION


Hi

I am using MSDTC and RPC to transfer data from one server to other.

It was working fine since last day but today my procedure is getting stuck at BEGIN DISTRIBUTION TRANSACTION command.

Any idea why?

Manish




View Complete Forum Thread with Replies

Related Forum Messages:
BEGIN TRANSACTION Or BEGIN DISTRIBUTED TRANSACTION
Hi have have two linked SQL Servers and I am trying to get things workingsmootly/quickly.Should I be using 'BEGIN TRANSACTION' or 'BEGIN DISTRIBUTED TRANSACTION' ?Basicly, these SPs update a local table and a remote table in the sametransaction. I cant have one table updated and not the other. Please dontsay replicate the tables either as at this time, this is is not an option.I have for example a number of stored procedures that are based around thefollowing:where ACSMSM is a remote (linked) SQL Server.procedure [psm].ams_Update_VFE@strResult varchar(8) = 'Failure' output,@strErrorDesc varchar(512) = 'SP Not Executed' output,@strVFEID varchar(16),@strDescription varchar(64),@strVFEVirtualRoot varchar(255),@strVFEPhysicalRoot varchar(255),@strAuditPath varchar(255),@strDefaultBranding varchar(16),@strIPAddress varchar(23)asdeclare @strStep varchar(32)declare @trancount intSet XACT_ABORT ONset @trancount = @@trancountset @strStep = 'Start of Stored Proc'if (@trancount = 0)BEGIN TRANSACTION mytranelsesave tran mytran/* start insert sp code here */set @strStep = 'Write VFE to MSM'updateACSMSM.msmprim.msm.VFECONFIGsetDESCRIPTION = @strDescription,VFEVIRTUALROOT = @strVFEVirtualRoot,VFEPHYSICALROOT = @strVFEPhysicalRoot,AUDITPATH = @strAuditPath,DEFAULTBRANDING = @strDefaultBranding,IPADDRESS = @strIPAddresswhereVFEID = @strVFEID;set @strStep = 'Write VFE to PSM'updateACSPSM.psmprim.psm.VFECONFIGsetDESCRIPTION = @strDescription,VFEVIRTUALROOT = @strVFEVirtualRoot,VFEPHYSICALROOT = @strVFEPhysicalRoot,AUDITPATH = @strAuditPath,DEFAULTBRANDING = @strDefaultBranding,IPADDRESS = @strIPAddresswhereVFEID = @strVFEID/* end insert sp code here */if (@@error <> 0)beginrollback tran mytranset @strResult = 'Failure'set @strErrorDesc = 'Fail @ Step :' + @strStep + ' Error : ' + @@Errorreturn -1969endelsebeginset @strResult = 'Success'set @strErrorDesc = ''end-- commit tran if we started itif (@trancount = 0)commit tranreturn 0

View Replies !
Unable To Begin A Distributed Transaction
I have this code
 DECLARE @tempTableName VarChar(50)SET @tempTableName = NEWID()
CREATE TABLE #@tempTableName( State Char(2), Billed Money, AslCode VarChar(10))INSERT INTO #@tempTableName EXEC GetRecords '2/1/2008'
which gives me this error when I run
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
GetRecords does a select * from a linked server's table. Which is working fine but if I try to do an insert (into temp table) then I get the error.
Any help?

View Replies !
Unable To Begin A Distributed Transaction
Having a SQL Server 2K (SP3a) with a link to another SQL Server 2K (noservice packs), distributed transactions works as expected most of thetime.But occasionally the MSDTC(s) seems to fall in a state of failure,causing the following error when involving distributed transactions:"The operation could not be performed because the OLE DB provider'SQLOLEDB' was unable to begin a distributed transaction.[OLE/DB provider returned message: New transaction cannot enlist inthe specified transaction coordinator. ]OLE DB error trace [OLE/DB Provider 'SQLOLEDB'ITransactionJoin::JoinTransaction returned 0x8004d00a]."The only way out of this state is to stop and start both of the SQLServers (stop/start of the DTC's doesn't help).Is this a common problem?Guess I will be recommended to install SP on the server withoutservice packs, but will this positively solve the problem describedabove?Could general network failures cause the error state described above,and if so - is there a way to make the MSDTC's survive or recover fromthe error situation automatically?--Morten Haugen

View Replies !
Unable To Begin A Distributed Transaction
I am using MSDASQL provider to create a linkedServer and is using Distrubuted Transaction in the application...but it is throwing out the following error...

Server: Msg 7391, Level 16, State 1, Line 1
The operation could not be performed because the OLE DB provider 'MSDASQL' was unable to begin a distributed transaction.
[OLE/DB provider returned message: [Microsoft][ODBC SQL Server Driver]Distributed transaction error]
OLE DB error trace [OLE/DB Provider 'MSDASQL' ITransactionJoin::JoinTransaction returned 0x8004d00a].


What keeps me guessing is that the same code worked in the development environment and had no problems in starting the Distributed Transaction...

Note: DTC is running on both the server and I am not using a loop back server!!!!


Please Help

View Replies !
Unable To Begin A Distributed Transaction (Msg 7391)
I am receiving the following error when I run a stored procedure:Server: Msg 7391, Level 16, State 1, Procedure spXXXXThe SP inserts data into a local (sql 2000) table from a remote sql2000 database. The SP works fine until I add a trigger to thedestination. The contents of the trigger do not appear to matter, as Ihave tried removing everything but one line, which is just a declarestatement. Updating the table with the trigger (even the full trigger)in place does not cause an error. Running the SP without the triggeron the table does not cause the error.I have the exact same setup on another server. Both the SP and thetrigger are IDENTICAL. This setup works on one server, but not theother. The only difference I can see is that the non-working server isWindows 2000 Server, while the working server is Windows 2003 Server.Any idea what's going on here?Thanks in advance.Eric

View Replies !
'SQLOLEDB' Was Unable To Begin A Distributed Transaction
SQL2000 / W2K
 

I'm having issues with a query to a view that references a view on a linked server, that in turn references a view on a third server.
 
Query to view on Server A -->  View on Server B  -->  View on Server C
 
I can query from A to B using the linked server.
I can query from B to C.
I can query from A to C.
 
All servers at the same location on the same domain.
 
I cannot query a view on A, that references a view on B, where the view on B references a view/table on C
 
Each linked server configuration uses "Be made using this security context", with the user specified being 'sa'.  I was hoping to get security out of the equation for debug purposes, hence the sa use.
 
I have tried from Query Analyzer using both windows and sql auth.
 
MSDTC is running on all servers as local system.
 
The full error returned is:
 
Server: Msg 7391, Level 16, State 1, Line 1
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
 
 
 
Thanks for any support,
 
Chris
 
 
 
 
 

View Replies !
'MSDAORA' Was Unable To Begin A Distributed Transaction - Why?! (SQL &<-&> Oracle)
Hello!I have an Oracle linked server connected through MSDAORA. Linked serverqueries work perfectly - the "openquery" ones as well as the4-part-named ones.The problem I have is with embedding the queries within SQL Servertriggers.Trigger:CREATE TRIGGER tgTest ON [dbo].[test]FOR INSERT, UPDATE, DELETEASselect * from openquery(LS, 'select * from ORACLE_TEST')executing "delete from test" in SQL Query Analyzer raises this error:Server: Msg 7391, Level 16, State 1, Procedure tgTest, Line 5The operation could not be performed because the OLE DB provider'MSDAORA' was unable to begin a distributed transaction.OLE DB error trace [OLE/DB Provider 'MSDAORA'ITransactionJoin::JoinTransaction returned 0x8004d01b].I've tried almost every solution I found online, but nothing helped:(This looked promissing: http://tinyurl.com/nk2wd , but it didn't get meany futher.Maybe someone can get me through the troubleshoot mentioned in thatlink:- check if DTC running properlyHow do I check that? If I open the "Support services" in EnterpriseManager and right-click the "Distributed Transaction Coordinatior" Ican stop the service, what indicates the service is running, but isthere anything else I should check? I have 0 items in the right windowpane of the DTC item, is it OK?- registry setting as discussed earlierThe following Registry Keys should be entered:[HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSDTCMTxOCI ]"OracleXaLib"="oraclient8.dll""OracleSqlLib"="orasql8.dll""OracleOciLib"="oci.dll"My entries are:"OracleOciLib"="ociw32.dll""OracleSqlLib"="SQLLib18.dll""OracleXaLib"="xa73.dll"Are they OK?- check if Mtxoci.dll is loadedThere is a Mtxoci.dll in my system32 dir, but how do I tell if it'sloaded? Should I regsvr32 it?- SET XACT_ABORT ON should be use in your SQL statement, for example:SET XACT_ABORT ONBEGIN DISTRIBUTED TRANSELECT statementCOMMIT TRANI've tried that, both in trigger but also surrounding the query thatfires the trigger.Am getting deseperate - please help. Will send candies!TIA

View Replies !
Linked Server And Unable To Begin A Distributed Transaction
I have a database containing my own tables and data and I wanted tobe able to query this against an accountancy program which has an ODBCdriver. This was never a problem with MS Access and Jet but I hit Jet'slimitations and have moved to SQL.Creating my own SQL database was no problem, but I was unsure of thebest way to be able to be able to have my SQL tables and my accountancysoftware tables appearing in the same Access front end.I created a linked server to the accountancy program. This wassuccessful in that I could see all the tables below the linked server inenterprise manager.My problem occurs when I try to bring the data from these tablesinto my SQL database.I create a new view in my database:-SELECT *FROM OPENQUERY(SAGE_SERVER, 'SELECT * FROM STOCK')(My linked server is called 'SAGE_SERVER' and I am trying to retrieveall columns from the STOCK table.)I then try to save this view and get the following errors.ODBC Error: [Microsoft][ODBC SQL Server Driver][SQL Server]The operationcould not be performed because the OLE DB provider 'MSDASQL' was unableto begin a distributed transaction.[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB Error Trace[OLE/DBProvider 'MSDASQL' ITransactionJoi JoinTransaction returned 0x8004d00a].Thanks in advance,Marcus Thornton.

View Replies !
OLE DB Provider 'MSDAORA' Was Unable To Begin A Distributed Transaction
Dear all,

I have been attempting to set up a linked server in SQL Server 2000 to point to an Oracle database (a very old Oracle database, v7!).

The linked server set up works fine. Then I created a database on the same SQL Server. Within that database I created a view which reads information from a view in the Oracle database (linked server). When I attempted to create this view in Enterprise Manager, I get the following error:

"The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction."

And so I created the view in Query Analyzer. This worked perfectly, no errors, and I can now go into Enterprise Manager and call up the view, which happily goes off to the view in the Oracle linked server and pulls back the info. BUT, when I attempt to do the same thing through an application on a different machine (using OLE Db, and a UDL to connect) the same error as above appears.

Does anyone know what this error means, and where I went wrong? Any help greatly appreciated. My view onto the linked server looks like this:

"CREATE VIEW dbo.NLPG_VIEW
AS
SELECT * from openquery(sadaslink, 'select * from NLPG_VIEW')"

Many thanks in advance for your wisdom!

P.S I wondered whether I need to check if the distributed transaction co-ordinator is running but don't know how.
Thanks,

View Replies !
Insert ... Exec Unable To Begin A Distributed Transaction
I have 3 development SQL Servers A, B & C, all running SQL 2000 sp3 and Windows 2003. Servers B & C have a linked server pointing to A, and A has one pointing to B & C. The linkedservers all have RPC , RPC out enabled. I have a stored procedure called test on server A.

Create Proc test
as

Select Top 5 first_name, last_name from people

GO


--code ran on Servers B & C:

create table #tmptbl (nm varchar(100), nm2 varchar(100))

insert into #tmptbl
Exec ServerA.db1.dbo.test


When the Insert....Exec code above is ran from server B it works fine, however when I run it from Server C, I get error 7391
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a]

But regular linked server calls (directly to tables) and openquery calls work fine from either server...

Eg
insert into #tmp
Select top 5 first_name, last_name from ServerA.db1.dbo.people

--and this works also

insert into #tmp
Select * from openquery(ServerA, 'Exec db1.dbo.test')


Both servers (B & C) appear to be configured the same, and
I have reconfigured MSDTC on all three boxes through control panel and component manager, have tried using SET xact_abort, SET implicit_transactions, registry hacks (TurnoffRPCsecurity), basically everything listed on Microsoft, and everything I've been able to find in these groups.

If anyone has any ideas, I'd like to hear them.

Tim.

View Replies !
The Operation Could Not Be Performed Because The OLE DB Provider 'SQLOLEDB' Was Unable To Begin A Distributed Transaction.
Hi,
 
I am facing the below mentioned error:
 
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
 
I have a Insert statement which i am using to insert data into a remote server from my local server. I have added the remote server as a linked server in my local server but when i try to execute the statement i am getting the above mentioned error. I am using Windows Enterprise Edition 2003 and SQL Server 2000.
 
I have also enabled the Allow InBound and Allow OutBound in the security configuration of My Computer properties but still i am facing the same problem. Kindly let me know how to resolve this issue.
 
Thanks.

View Replies !
Transaction Scope - The Operation Could Not Be Performed Because OLE DB Provider &"SQLNCLI&" For Linked Server &"XXX_LINKED_SERVER&" Was Unable To Begin A Distributed Transaction. OLE DB Provider &"SQLNCLI&a
Hello, I've a problem with a software developed in C# with the framework 2.0. This is the error I receive : The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "XXX_LINKED_SERVER" was unable to begin a distributed transaction. OLE DB provider "SQLNCLI" for linked server "XXX_LINKED_SERVER" returned message "No transaction is active.". If I try directly to restart the process, it works fine. Is there someone who can help me ? This is the process 1. In C# --> Call of a Query : select from the linked server (db in sql 2005) and insert into a table SQL 2005 2. In the C# --> using (TransactionScope scope = new TransactionScope()) and insert in a table in SQL 2005 which is link server Thank in advance.

View Replies !
The Microsoft Distributed Transaction Coordinator (MS DTC) Has Cancelled The Distributed Transaction.
We have a test db, a staging db and a live db.  I have a stored procedure that runs fine on test and staging, but throws the following error on live. 
 

The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.

 
The stored procedure uses linked servers and a transaction.
We're using the following transaction code in the stored procedure

BEGIN

BEGIN TRANSACTION

BEGIN TRY

---
procedure stuff here
---
COMMIT TRANSACTION
END TRY



BEGIN CATCH

DECLARE @ErrorSeverity INT, @ErrorNumber INT, @ErrorMessage NVARCHAR(4000), @ErrorState INT

SET @ErrorSeverity = ERROR_SEVERITY()

SET @ErrorNumber = ERROR_NUMBER()

SET @ErrorMessage = ERROR_MESSAGE()

SET @ErrorState = ERROR_STATE()



IF @ErrorState = 0

SET @ErrorState = 1



RAISERROR ('ERROR OCCURED:%d', @ErrorSeverity, @ErrorState, @ErrorNumber)

IF XACT_STATE() < 0

ROLLBACK TRANSACTION

END CATCH

 

END

 
I found the following link which seems to be the problem we're experiencinghttp://support.microsoft.com/kb/937517
 
The link includes a workaround which is the following:
"To prevent the SQLNCLI provider from sending an attention signal to the server, use the SQLNCLI provider to consume fully any rowsets that the OLE DB consumer creates. "
 
 
How do I use the SQLNCLI provider to fully consume any rowsets?

View Replies !
OLE DB Provider 'SQLOLEDB' Was Unable To Begin A Distributed Transactio
Hi All,
 
I am getting following Error:
Oracle linked server in SQL server 2005 to update tables in Oracle database.
I have used OPENQuery to update tables in Oracle from a SQL Server 2005 Stored procedure.
  
If we run query from sql management studio for inserting or updating table of linked server then it runs fine. But if we use Begin distributed transaction then its gives error -

Server: Msg 7391, Level 16, State 1, Procedure sp_test, Line 105
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
We are using Sql server stored procedure to run the open query syntax for updating oracle interface table.

View Replies !
Error 8525: Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.
Hi All
 
I'm getting this when executing the code below.  Going from W2K/SQL2k SP4 to XP/SQL2k SP4 over a dial-up link.
 
If I take away the begin tran and commit it works, but of course, if one statement fails I want a rollback.  I'm executing this from a Delphi app, but I get the same from Qry Analyser.
 
I've tried both with and without the Set XACT . . ., and also tried with Set Implicit_Transactions off.
 
set XACT_ABORT ON
Begin distributed Tran
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TRANSACTIONMAIN
 set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TRANSACTIONMAIN
 set REPFLAG = 0 where REPFLAG = 1 and DONE = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.WBENTRY
 set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.WBENTRY
 set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.FIXED
 set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.FIXED
 set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.ALTCHARGE
 set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.ALTCHARGE
 set REPFLAG = 0 where REPFLAG = 1
update OPENDATASOURCE('SQLOLEDB','Data Source=10.10.10.171;User ID=*****;Password=****').TRANSFERSTN.TSADMIN.TSAUDIT
 set REPFLAG = 0 where REPFLAG = 1
update TSADMIN.TSAUDIT
 set REPFLAG = 0 where REPFLAG = 1
COMMIT TRAN

 
It's got me stumped, so any ideas gratefully received.Thx

View Replies !
SSIS, Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.
I have a design a SSIS Package for ETL Process. In my package i have to read the data from the tables and then insert into the another table of same structure.

for reading the data i have write the Dynamic TSQL based on some condition and based on that it is using 25 different function to populate the data into different 25 column. Tsql returning correct data and is working fine in Enterprise manager. But in my SSIS package it show me time out ERROR.

I have increase and decrease the time to catch the error but it is still there i have tried to set 0 for commandout Properties.

if i'm using the 0 for commandtime out then i'm getting the Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.

and

Failed to open a fastload rowset for "[dbo].[P@@#$%$%%%]". Check that the object exists in the database.

Please help me it's very urgent.

View Replies !
TRANSACTIONS In SSIS (error: The ROLLBACK TRANSACTION Request Has No Corresponding BEGIN TRANSACTION.&&"
I'm receiving the below error when trying to implement Execute SQL Task.

"The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION." This error also happens on COMMIT as well and there is a preceding Execute SQL Task with BEGIN TRANSACTION tranname WITH MARK 'tran'

I know I can change the transaction option property from "supported" to "required" however I want to mark the transaction. I was copying the way Import/Export Wizard does it however I'm unable to figure out why it works and why mine doesn't work.

Anyone know of the reason?

View Replies !
Using Begin Transaction,End Transaction, Return,Rollback, Break,Continue
Hi, is there someone who can demonstrate the usgae of these codes in this simple process. I have a table that has (id int, Balance money)
I want to write codes to utilize the Subject coding in this process.
1.Every time I withdraw money from a client, I want to verrify that he/she has enough money if not I want to roll back transaction.
2.Using Begin Tran , end Tran..
3. Using Return ,Break,continue

I really appreciate your help. Althought I read about this from a book, but it really confused me and I want to see real world example using client and withdraw from there accounts...:)

regards
Ali

View Replies !
Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.
Hi all, I've already read the thread by the same topic, but I found Kevin Yu's comment a bit confusing.  I don't know how to solve my problem.  I have two stored procedures in sql server.  First one inserts into a bunch of tables so it has Begin Transaction and Commit in it.  Second one just inserts into one table so it doesn't have the begin transaction statement in it. From my data access class in c#.net, I have a function which calls both of these stored procedures from within a "using transactionscope" block.  So when it makes the call to the first stored procedure, it returns fine, but when it calls the second one, I get the above error.   I think it has something to do with me declaring transactionscope in my application code, and then calling a stored procedure which also has its own begin transaction.  But I don't know how to fix this.  Any ideas? Thanks 

View Replies !
Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction
I'm using TransactionScope object and it is giving me problems. The situation is like this.
I've 2 tables in sql server express, say student and courses and other one studentcourse for courses a student has opted for.
An aspx page displays list of users in listbox, when user chooses student, it fetches courses he has opted for and in the checkedlistbox (for courses) these courses are checked. Now when uses makes any changes to courses and clicks update button, i've
two functions at backend first one removes the courses which were previously selected but now not selected in postback, next it inserts courses which was not selected first but now are in this postback.
I use following code:

protected void Update(object sender, EventArgs e)
{
/*
get selections, existing courses etc.
*/
using(TransactionScope tscope=new TransactionScope())
{
try
{
RemoveCourses(/*Student*/ s, /*IList*/ oldCourses, /*IList*/ newCourses);
AddCourses(/*Student*/ s, /*IList*/ oldCourses, /*IList*/ newCourses);
tscope.Complete();
}
catch(Exception ex)
{
lblMessage.Text=ex.Message;
}
}
}

If any exception occurs during update and page is reload or I go to any other page where some data is fetched from sql server I get the exception:
Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction

Please help!

View Replies !
Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.
I am getting this error  :Distributed transaction completed. Either enlist this session in a new
transaction or the NULL transaction. Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.Data.OleDb.OleDbException: Distributed transaction completed. Either
enlist this session in a new transaction or the NULL transaction.have anybody idea?!

View Replies !
Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction.
i have a sequence container in my my sequence container i have a script task for drop the existing tables. This seq. container connected to another seq. container. all these are in for each loop container when i run the package it's work fine for 1st looop but it gives me error for second execution.

Message is like this:

Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.

View Replies !
Distributed Transaction Completed. Either Enlist This Session In A New Transaction Or The NULL Transaction. (HELP)
Hi,
 
i am getting this error "Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.".
 
my transations have been done using LINKED SERVER. when i manually call the store procedure from Server 1 it works but when i call it through Service broker it dosen't work and gives me this error.
 
 
 
Thanks in advance.
 
 
 

View Replies !
How Do I Make Use Of Begin Transaction And Commit Transaction In SSIS.
Hi

 

How do I make use of begin transaction and commit transaction in SSIS.

As am not able to commit changes due to certain update commands I want to explicitly write begin and commit statements. but when i make use of begin and commit in OLEDB commnad stage it throws an error as follows:

Hresult:0x80004005

descriptionyntax error or access violation.

 

its definately not an syntax error as i executed it in sql server. also when i use it in execute sql task out side the dataflow container it doesnt throw any error but still this task doesnt serve my purpose of saving/ commiting update chanages in the database.

 

Thanks,

Prashant

View Replies !
Usage Of Begin Transaction.... Commit Transaction??
Hi, anyone can help,I am trying to learn how to use begin tran..commit tran .. rollback tran by doing this exercise... unfortunatelly,it did not work...anyone can help...
I have a table named tbl_balance(investor_id int,amount money)
I want to insert/update balance for each investor. I wrote a procedure but it didnot work:::

declare @investorid int, @amount money,@error_status int
select @investorid=1
select @amount = 500
/* to check if investor exist in the tbl_balance table, if so execute the codes */
IF exists(select investorid from tbl_bal where investorid=@investorid )
begin tran
begin
update tbl_balance
set amount=amount+@amount
where investorid =@investorid

if (@error_status<> 0)
begin
ROLLBACK tran
select 'you did not update'
end
else
begin
COMMIT tran
select ' YOu did update '
end
end

IF not exists(select investorid from tbl_bal where investorid=@investorid )
begin tran
begin
insert into tbl_balance
values(@investorid,@amount)

if (@error_status<> 0)
begin
ROLLBACK tran
select 'you did not update'
end
else
begin
COMMIT tran
select ' YOu did update '
end
end

View Replies !
BEGIN TRANSACTION COMMIT TRANSACTION Help
I had thought that if any statement failed within a BEING TRANS .. COMMIT TRANS block, then all the statements would be rolled back. But I am seeing different behavior (SQL Server 2000 8.00.2039)

For instance, run these statements to set up a test:
--DROP TABLE testTable1
--DROP TABLE testTable2
CREATE TABLE testTable1 (f1 varchar(1))
CREATE TABLE testTable2 (f1 varchar(1))
CREATE UNIQUE INDEX idx_tmptmp ON testTable1 (f1)
insert into testTable1(f1) values ('a')

So table testTable1 has a unique index on it..

Now try to run these statements:

--DELETE FROM testTable2
BEGIN TRANSACTION
insert into testTable1(f1) values ('a')
insert into testTable2(f1) values ('a')
COMMIT TRANSACTION

SELECT * FROM testTable2


..the first insert fails on the unique index.. but the second insert succeeds. Shouldn't the second insert roll back? How can I make two operations atomic?

View Replies !
BEGIN TRANSACTION And COMMIT TRANSACTION
I am executing a stored procedure something like this

Create Procedure TEST
@test1
@test2
AS
BeGIN TRANSACTION ONE
SELECT...
UPDATE..
....
....

....
TRUNCATE
etc and lot of Select,update and delete statements like this
.....
COMMIT TRANSACTION ONE


The Block of code which I have b/w BEGIN TRANSACTION AND COMMIT TRANSACTION ..Will it be rolled back
if it encounters any errors in the SELECT,UPPDATE,DELETE ..statements which I have with the transaction one.
IF not How do I roll back if it encounters any erros b/w the BEGIN TRANSACTION and END TRANSACTION.

Thanks
micky

View Replies !
Begin Transaction In Asp.net
Hi All,Can any one help by giving me the details/difference in using the Transaction Isolation Levels (read uncommitted, read committed, repeatable read, or serializable)in asp.net. I just want to know in which case we can use these things in begining a transaction, and will it improve the performance. thanks in advance Boo

View Replies !
Begin Transaction
Could someone tell me if this is the correct way to begin and commit a transaction:

CREATE procedure AddTitle
@title varchar(255),
@descriptions varchar(255),
@mediaId int,
@quantityowned int,
@classificationid int


AS
BEGIN Tran TranStart

Set NOCOUNT ON
declare @titleid int --declaring the titleid


INSERT INTO Titles(title, [descriptions])
values(@title,
@descriptions)


set @titleid = SCOPE_IDENTITY() --grabbing the id to be placed in the other table


INSERT INTO Resources(titleid,mediaid,quantityowned)
values(@titleid,
@mediaid,
@quantityowned)

insert into titleclassification(titleid, classificationid)
values(@titleid, @classificationid)

select @titleid as titleid -- return to caller if needed

Commit Tran Transtart
GO

Where would I put rollback transaction? Do I need it?

Thanks!

View Replies !
Use Of Begin/End Transaction
I need to copy two large tables from one database into another, via the internet. I haven't worked out exactly how yet, but the first issue which has occurred to me is that by the time the first table has been exported (via a SELECT clause?) into a suitable file, the second table (to which it is related) will be out of sync. So, how do I ensure that I end up with a snapshot of the two tables, perfectly in sync with each other? I know that BEGIN/END TRANSACTION makes sure that UPDATES to tables remain in sync, but will it work just for SELECT statements?

View Replies !
C# SQLTransaction Or SQL BEGIN TRANSACTION
I want to know if it's a good practice to use sql-transaction in both c# and sql procedures code.

View Replies !
Where Should I BEGIN/END Transaction? In Code Or In The SP?
I notice you can do a END and BEGIN trasaction in BOTH. But I hope BOTH are not needed. So where so I use them  ?
 
Or should I even use them for simple updates and inserts ?

View Replies !
Deadlocks && BEGIN/END TRANSACTION
Greetings,I've been reading with interest the threads here on deadlocking, as I'mfinding my formerly happy app in a production environment suddenlydeadlocking left and right. It started around the time I decided towrap a series of UPDATE commands with BEGIN/END.The gist of it is I have a .NET app that can do some heavy reading (nowriting) from tblWOS. It can take a minute or so to read all the datainto the app, along with data from other tables.I also have a web app out on the floor where people can entertransactions which updates perhaps 5-20 records in tblWOS at a time.The issue comes when someone is loading data with the app, and someoneelse tries an update through the web app: deadlocks-ville on theapplication and/or the web app.Again, I believe it began around the time I wrapped those 5-20 recordupdates to tblWOS on the web app with BEGIN/END. The funny thing isthat the records involved are not the same ones, so I'm thinking somekind of table-level lock is going on.I've played with UPDLOCK in examples, but don't quite understand whatit's attempting to do. Since the web update is discrete and short, andit is NOT updating records that are getting loaded, I'd like theBEGIN/UPDATE/END web transaction to happen and not deadlock the loadingapplication.Any suggestions? I'd be most grateful.thanks, Leaf

View Replies !
BEGIN And COMMIT Transaction
Can help me?
I have to insert BEGIN and COMMIT Transaction in my stored procedure (call to a trigger)





Code Snippet

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO

ALTER                                             PROCEDURE [dbo].[DETTAGLIO_TURNI_DIFENSORI]

(
@tipo_albo VARCHAR(50),
@data_inizio DATETIME,
@data_fine DATETIME,
@descrizione VARCHAR(50),
@idturno INT,
@n_dif INT
)

AS


-- DICHIARAZIONE VARIABILI...
DECLARE @dett_idturno as INT
DECLARE @totale_giorni as INT
DECLARE @tipo_albo_A as VARCHAR(9)
DECLARE @tipo_albo_B as VARCHAR(9)
DECLARE @data_odierna as DATETIME
DECLARE @tot_avvocati as INT
DECLARE @avv_giorno as INT
DECLARE @avv_giornoA as INT
DECLARE @avv_giornoB as INT
DECLARE @conta_giorni as INT
DECLARE @incremento_giorni as INT
DECLARE @incr_dif_giorno as INT
DECLARE @nuovo_idturno as INT
DECLARE @idalboturno as INT
DECLARE @old_turni as INT
DECLARE @tot_giorniA as INT
DECLARE @tot_giorniB as INT
DECLARE @conta_giorni_incremento as INT
DECLARE @conta_avvocati as INT
DECLARE @avv as INT
DECLARE @altri_turni AS INT
DECLARE @neg_giorni_incremento as int
-------------------------------------------------------------------------------------------------------

-- SET VARIABILI PER EVITARE PROBLEMI CON NULL o 0
SET @totale_giorni = 0
SET @tot_avvocati = 0
SET @avv_giorno = 0
SET @conta_giorni = 0
SET @incremento_giorni = 0
SET @incr_dif_giorno = 0
SET @idalboturno = 0
SET @old_turni = 0
--------------------------------------------------------------------------------------------------------

SET @nuovo_idturno = @idturno

BEGIN TRAN

-- conta i giorni
SELECT @totale_giorni = (DATEDIFF(dd, @data_inizio, @data_fine))+1

-- select da vista avvocati per tipo difensori selezionato.. (controllare anche data_fine_iscrizione?)

    create table #Tmp   
    (
    [ID_anagrafica] varchar(50)
    )

IF @tipo_albo = 'DIFO'
BEGIN
    SET @tipo_albo_A = 'DIFM'
    SET @tipo_albo_B = 'CPT'
   
    -- select per contare..
   
    SELECT @tot_avvocati = COUNT(*)
    FROM VALBO_ISCRIZIONE_DIF_ORDINARI
   
    SELECT @tot_avvocati As tot_avvocati

    -- creo tabella temporanea..
    INSERT INTO #Tmp
    SELECT [ID_anagrafica]
    FROM VALBO_ISCRIZIONE_DIF_ORDINARI ORDER BY ID_ANAGRAFICA   

END

IF @tipo_albo = 'DIFM'
BEGIN
    SET @tipo_albo_A = 'DIFO'
    SET @tipo_albo_B = 'CPT'

    -- select per contare..
    SELECT @tot_avvocati = COUNT(*)
    FROM VALBO_ISCRIZIONE_DIF_MINORI
   
    SELECT @tot_avvocati as tot_avvocati

    -- creo tabella temporanea..
    INSERT INTO #Tmp
    SELECT [ID_anagrafica]
    FROM VALBO_ISCRIZIONE_DIF_MINORI ORDER BY ID_ANAGRAFICA   
END

IF @tipo_albo = 'CPT'
BEGIN
    SET @tipo_albo_A = 'DIFM'
    SET @tipo_albo_B = 'DIFO'
   
    -- select per contare..
    SELECT @tot_avvocati = COUNT(*)
    FROM VALBO_ISCRIZIONE_DIF_CPT
   
    SELECT @tot_avvocati as tot_avvocati
   
    INSERT INTO #Tmp
    SELECT [ID_anagrafica]
    FROM VALBO_ISCRIZIONE_DIF_CPT ORDER BY ID_ANAGRAFICA   
END
 
DECLARE @idanagrafica varchar(50)

-- GIORNI PER AVVOCATO
-- tot_giorni * n_dif_minimo / tot_avvocati = tot_giorni_avvocato (con intero successivo)
SET @incremento_giorni = ((@totale_giorni * @n_dif)/@tot_avvocati)
-- controllo se c'è resto..
IF ((@totale_giorni * @n_dif)%@tot_avvocati) <> 0
BEGIN
    SET @incremento_giorni = @incremento_giorni + 1
END

-- ogni avvocato deve essere difensore per almeno 2 giorni di seguito..
-- quindi se l'incremento è minore di 2 deve essere uguale a 2
IF @incremento_giorni < '2'
BEGIN
     SET @incremento_giorni = '2'
END

-- AVVOCATI AL GIORNO
-- numero variabile.. prendere in considerazione il primo intero e l'intero successivo..
SET @avv_giorno = (@incremento_giorni * @tot_avvocati)/@totale_giorni
SET @avv_giornoB = @avv_giorno

-- controllo il resto della divisione.. se <> 0 @avv_giornoB = @avv_giorno + 1..
-- altrimenti i due valori sono uguali..

IF ((@incremento_giorni * @tot_avvocati)%@totale_giorni) <> 0
BEGIN
    SET @avv_giornoA = @avv_giorno + 1
END
ELSE
BEGIN
    set @avv_giornoA = @avv_giorno
END

-- conteggi giorni totali difensori...
-- giorni con N difensori
SET @tot_giorniB = ((@avv_giornoB * @incremento_giorni)/@totale_giorni)
-- giorni con M difensori
SET @tot_giorniA = @totale_giorni - @tot_giorniB

declare @totale as int
declare @conta_inseriti as int
set @conta_inseriti = 0
set @totale = (@avv_giornoA * @tot_giorniA) + (@avv_giornoB * @tot_giorniB)

-- ciclo per totale dei giorni
SET @conta_giorni = 1
SET @conta_giorni_incremento = 0
SET @conta_avvocati = 0
WHILE @conta_giorni <= @totale_giorni BEGIN
   
    -- ogni giorno @avv deve essere ZERO
    SET @avv = 0
   
    IF @conta_giorni <= @tot_giorniA
    BEGIN   
         SET @avv_giorno = @avv_giornoA
        END
        ELSE
        BEGIN   
         SET @avv_giorno = @avv_giornoB
        END
   
    -- ciclo per ogni giorno per totale di avvocati/giorno
    SET @incr_dif_giorno = 0
   
    WHILE (@incr_dif_giorno < @avv_giorno) AND EXISTS(SELECT TOP 1 ID_anagrafica FROM #Tmp) BEGIN

        SET @conta_avvocati = @conta_avvocati + 1   
   
        SET @data_odierna = DATEADD(dd, (@conta_giorni-1), @data_inizio)

        SET @neg_giorni_incremento = -1 * @conta_giorni_incremento

        SET @old_turni = 0
        SET @altri_turni = 0
 
            SELECT TOP 1 @idanagrafica = ID_anagrafica from #Tmp
            DELETE #Tmp WHERE ID_anagrafica = @idanagrafica

            -- query che controlla i turni già assegnati per altre liste...

            SELECT @old_turni = COUNT(*)
            FROM Albo_Turno_Dettaglio CROSS JOIN
               ALBO_TURNO
            WHERE
               Albo_Turno_Dettaglio.idalbo = @idanagrafica
            AND
              (
              ALBO_TURNO.Tipo = @tipo_albo_A   --- probabile problema con trigger
            OR
              ALBO_TURNO.Tipo = @tipo_albo_B
            )
            AND
              (
               Albo_Turno_Dettaglio.Data
            BETWEEN
              DATEADD(dd, (@neg_giorni_incremento + 1), @data_odierna)
            AND
              DATEADD(dd, (@incremento_giorni-@conta_giorni_incremento), @data_odierna)
             )

                SELECT @old_turni AS old_turni

            -- (nel caso in cui il ciclo ricominci..) controllare che questo avvocato non abbia
            -- già un set di giorni in questo turno...

            -- passato il primo controllo.. deve passare anche questo..
                   
            SELECT @altri_turni = COUNT(*)
            FROM Albo_Turno_Dettaglio
            WHERE
            Albo_Turno_Dettaglio.idalbo = @idanagrafica
            AND
            Albo_Turno_Dettaglio.idturno = @nuovo_idturno        
       
            SELECT @altri_turni AS altri_turni

            IF @old_turni = NULL
            BEGIN
            SET @old_turni = 0
            END
           
            IF @ALTRI_TURNI = NULL
            BEGIN
            SET @ALTRI_TURNI = 0
            END
       
            IF (@old_turni = 0 AND (@altri_turni = 0 OR @altri_turni < (@incremento_giorni)))
            BEGIN
                       -- se non ci sono turni sovraposti assegna il turno all'avvocato x N giorni (incremento_giorni)
                      -- seleziono il dettaglio con idturno max per aumentare di uno...           
                SET @idalboturno = 1
                SET @dett_idturno = 1
                SELECT @dett_idturno = MAX(idalboturno)
                FROM Albo_Turno_Dettaglio
           
                if (@dett_idturno) = null
                begin
                    set @dett_idturno = 0
                end
       
                  SET @idalboturno = @dett_idturno + 1

BEGIN TRAN

                  INSERT Albo_Turno_Dettaglio
                  (
                    idalboturno,
                   idalbo,
                    idturno,
                    data
                  )
                  VALUES
                  (
                     @idalboturno,
                     @idanagrafica, -- da cursore
                     @nuovo_idturno,
                     @data_odierna -- problemi inserimento data??
                  )
               
COMMIT
                  -- valorizza il numero degli avvocati del giorno + 1
                      SET @incr_dif_giorno = @incr_dif_giorno + 1
            END
            ELSE
            BEGIN
                  -- non incrementare la variabile...
                SET @incr_dif_giorno = @incr_dif_giorno
                END
       
        END -- END WHILE AVVOCATI PER GIORNI

        SET @conta_giorni_incremento = (@conta_giorni_incremento + 1)
             IF @conta_giorni_incremento < @incremento_giorni
             BEGIN
            --DEVO RIPOPOLARE LA TABELLA PERCHE' OGNI AVVOCATO DEVE AVERE X GIORNI..
            -- cancello tutti i record e poi inserisco di nuovo..       
            DELETE FROM #Tmp
            IF @tipo_albo = 'DIFO'
            BEGIN

                INSERT INTO #Tmp
                SELECT [ID_anagrafica]
                FROM VALBO_ISCRIZIONE_DIF_ORDINARI ORDER BY ID_ANAGRAFICA   
            END

            IF @tipo_albo = 'DIFM'
            BEGIN

                INSERT INTO #Tmp
                SELECT [ID_anagrafica]
                FROM VALBO_ISCRIZIONE_DIF_MINORI ORDER BY ID_ANAGRAFICA   
            END

            IF @tipo_albo = 'CPT'
            BEGIN
           
                INSERT INTO #Tmp
                SELECT [ID_anagrafica]
                FROM VALBO_ISCRIZIONE_DIF_CPT ORDER BY ID_ANAGRAFICA   
            END

             END
        ELSE
             BEGIN
            set @conta_giorni_incremento = 0
             END           

        SET @conta_giorni = @conta_giorni + 1
END
 
DROP TABLE #TMP

COMMIT TRAN


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

View Replies !
Sql2005:Cannot Use SAVE TRANSACTION Within A Distributed Transaction
Error returned when trying to commit the transaction to a database that is a replication distributor. (sql2005 ctp16)

View Replies !
Begin Tran In An Sp Executed Fom Within A Transaction Scope
we have an update sp that must call an insert sp after the update.  The update and insert must act like a transaction, ie all or none.
 
We believe that wrapping most of the update (including call to insert sp) sp in a begin tran block would guarantee the all or none behavior.
 
However, we're not sure what would happen if one of our developers calls the update sp from within a transaction scope that expects yet something additional to be included in the transaction.  Would the begin tran block (assuming no errors in that block) in the sp commit both the update and insert regardless of what happens in the rest of the .net tran scope?       

View Replies !
Why Transaction Gets Promoted To Distributed Transaction
Hi,On My local SQL server I have added a linked server to another SQLserver (remoteserver) in another Windows NT Domain.When I run this codeselect count(*) from remoteserver.mosaics.dbo.LocationThis works fine.However when I usebegin transactionselect count(*) from remoteserver.mosaics.dbo.LocationIt errors out saying thatThe operation could not be performed because the OLE DB provider'SQLOLEDB' was unable to begin a distributed transaction.New transaction cannot enlist in the specified transactioncoordinator. ]OLE DB error trace [OLE/DB Provider 'SQLOLEDB'ITransactionJoin::JoinTransaction returned 0x8004d00a].My question is even though I am just reading data from theremoteserver, why does the local transaction get promoted to adistributed transaction.Any help will be grately appreciated.TIA...Rohit

View Replies !
Begin And End Transaction And Transaction Log
Hello everyone,This is more of an architectural question about SQL Server. Cansomeone please explain why when I perform a query such as the onebelow that updates a table using begin and end transaction I am unableto programmatically truncate the transaction log. The only way I havefound to truncate the transaction log is to stop and start the SQLServer Service. Does this transaction use the tempdb? Is that why Iam unable to truncate the transaction log? Is there a better way todo this?Begin trans T1Update sometableSet random_row = 'blah'End trans T1Thanks!

View Replies !
Distributed Transaction....
I have the following error:Server: Msg 7391, Level 16, State 1, Line 1The operation could not be performed because the OLE DB provider'SQLOLEDB'was unable to begin a distributed transaction.[OLE/DB provider returned message: New transaction cannot enlist inthespecified transaction coordinator. ]I have DTC services running in both servers, SET XACT_ABORT clause, ipaddress in hosts file, there´s not a firewall between servers,The only difference is sql server version, server A have Personaledition, server B have Standard edition Sql 2000...what im doing wrong???sorry for my english, but its not my native language...

View Replies !
Distributed Transaction
Hi all,
I am trying to merge data of 2 tables on different servers with an insert statement.

INSERT INTO SERVER1.db.owner.table
select s2.* from SERVER2.db.owner.table as s2
LEFT JOIN SERVER1.db.owner.table as s1
ON s1.key=s2.key
where s1.key is null

I got this error.
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].


while the select query is giving the result.
I have done simmilar inserts on some other tables which worked fine

I have created sp_addlinkedserver.
and DTC set on both servers.

any help will be greatly appreciated

View Replies !
Distributed Transaction
Hi All,
I am trying to use distributed transaction (using linked Server).
But getting the folloing error..

Some one please help...


following is the error...

The operation could not be performed because the OLE DB provider 'MSDASQL' was unable to begin a distributed transaction.

[OLE/DB provider returned message: [Microsoft][ODBC SQL Server Driver][SQL Server]Transaction context in use by another session.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' ITransactionJoin::JoinTransaction returned 0x8004d00a].

View Replies !
Why A Distributed Transaction Here?
I want to execute a remote stored proc and put the results in a local table.

MachineB is a linked server on MachineA.

I can do this succesfully on MachineA....

EXEC [MachineB].master.dbo.sp_helpdb

I can also do either of these without any trouble....

SELECT * INTO local_copy FROM [MachineB].master.dbo.sysdatabases
or
INSERT INTO local_copy(name, dbid) SELECT name, dbid FROM [MachineB].master.dbo.sysdatabases


...assuming in the 2nd case that table 'local copy' has the appropriate matching columns.

But I CAN'T do this..... (and the target table is correct)

INSERT INTO local_copy
EXEC [MachineB].master.dbo.sp_helpdb

I get the error ""The transaction manager has disabled its support for remote/network transactions." or sometimes "The partner transaction manager has disabled its support for remote/network transactions." Whether or not the word 'partner' appears may be OS-level dependent.

I have SET IMPLICIT_TRANSACTION OFF set.

What I don't get is why INSERT ... remote-SELECT is not a distributed transaction and INSERT ... remote-EXEC is

It's probably not going to help to use component services to allow remote transactions, because I'm not going to be able to do inbound authentication. (different domains wo/trust) And inbound authentication WILL be set on some targets because it HAS to be set on clusters. I don't like this... it's Microsoft forcing Windows authentication down our throats, even that that's not practical in lots of scenarios - such as when some participating nodes are some OS other than Windows. So for me the solution seems to be for this NOT to be a distributed transaction. Why should it be, when INSERT...remote-select doesn't have to???? Besides, only one machine is getting updated. No need to coordinate changes on multiple machines.

View Replies !
Distributed Transaction
Hi,

I have a quick question about distributed transaction.

We currently use a stored procedure to insert data in two tables, one of the table is located on a SQL 2000 server and the other one on an Oracle server (Linked server).

I would like to ensure data integrity between the two server. For some reason i'm not able to retreive an error code from oracle when the transaction fail...

How could the SP Rollback the entire transaction on SQL and Oracle side?

Here is an example of the SP we use:

CREATE PROCEDURE PLB_1_sp
(@Value1 INTEGER,
@Value2 INTEGER)
AS
BEGIN

SET XACT_ABORT ON
BEGIN DISTRIBUTED TRANSACTION

INSERT INTO SQL1
VALUES (@Value1,@Value2)

IF (@@ERROR <> 0) GOTO ERROR_HANDLER

INSERT INTO linkedSvr..ORACLE.Table1
VALUES (@Value1,@Value2)

IF (@@ERROR <> 0) GOTO ERROR_HANDLER

COMMIT TRANSACTION

ERROR_HANDLER:
ROLLBACK TRANSACTION
SET XACT_ABORT OFF

END

Thanks for your help

View Replies !
Distributed Transaction
I got following error when i tried to run a procedure which
has a distributed tran in it:

The operation could not be performed because the OLE DB provider 'SQLOLEDB' does not support distributed transactions.
[OLE/DB provider returned message: Distributed transaction error]

both my local and linked server has DTC service running,
sql7 with sp1

any idea why it still give me this error?
Thanks!

View Replies !
Distributed Transaction
Hi again,
I do not know when to use Distributed Transaction.
Would you please give an example about its usage or give a tutorials about this ?

Thanks

View Replies !
SCOPE_IDENTITY( ) In Distributed Transaction [:S]
i am inserting new record in linked server and i need to get the id (which is of course autonumber) of newly added record. can't i get it using SCOPE_IDENTITY( ) ? SCOPE_IDENTITY( ) seems to be returning null. so SCOPE_IDENTITY( ) doesn't work in distributed transaction?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved