Execute a distributed transaction for an Oracle linked server using SQL Server 2000
By : user1724519
Date : March 29 2020, 07:55 AM
it fixes the issue To enroll SQL Server and Oracle in a distributed transaction MSDTC needs to have XA transactions enabled. See Supporting XA Transactions:
|
Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing - SQL server 2005
By : anil bhatt
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I don't think anything is missing. It's probably an inner stored procedure that gets called from inside a transaction (TRANCOUNT = 1), starts its own transaction (TRANCOUNT = 2) and then rolls it back. Well, it means to roll it back, but rollback affects all transactions and not only the innermost one, so the procedure screws up the execution flow. A way to find the place depends on available tools/skills. A better way is to use SQL Profiler that shows all commands executed by an application against the server. Find out the outermost stored procedure and go through its code looking for any other procedure calls.
|
Execute Statements in a Transaction - Sql Server 2005
By : klpx
Date : March 29 2020, 07:55 AM
I wish did fix the issue. i need to update a database where some of the table have changed (columns have been added). I want to perform this action in a proper transaction. If the code executes without any problem then i will commit the changes otherwise i will rollback the database back to its original state. code :
Begin Transaction
Alter Table dbo.MyTable
Add Col1 varchar(50)
If @@Error = 0
Begin
Commit Transaction
End
Else
Begin
Rollback Transaction
End
|
How to get transaction execute time in SQL Server?
By : Abigail Mathis
Date : March 29 2020, 07:55 AM
may help you . Save the time before and after the query and to calculate the difference, something like this: code :
DECLARE @start_time DATETIME, @end_time DATETIME
SET @start_time = CURRENT_TIMESTAMP
-- query goes here
SET @end_time = CURRENT_TIMESTAMP
SELECT DATEDIFF(ms, @start_time, @end_time)
|
Execute sql-server transaction using python
By : j20
Date : March 29 2020, 07:55 AM
like below fixes the issue When you create a connection object, you can tell it not to commit every command you execute. Then, when you have executed all the commands you wanted, you can commit them all in one transaction. code :
myconnection = pyodbc.connect(myconnectionstring, autocommit=False)
# your commands here
myconnection.commit()
|