New answers tagged

0 votes

how can I see how many records have been affected by a transaction before it is committed? or how costly would be the rollback if I have to kill it?

You can use sys.dm_tran_database_transactions to find out how much log has been written and therefore whether it needs to be rolled back. select dt.database_transaction_log_bytes_used, dt....
Charlieface's user avatar
  • 12.5k
1 vote
Accepted

Repeatable reads in case protection from duplicated inserts in POSTGRES

Yes, the SERIALIZABLE isolation level is the only way for the database to guarantee that no anomalies can occur. Serializing the execution of the function using advisory locks would only help if that ...
Laurenz Albe's user avatar
  • 50.3k
3 votes

Understanding Lock Behavior in SQL Server Deadlock Scenario with INSERT

It seems to be an extremely complicated setup for something that is only designed to test a principle. If I understand the code correctly, you begin with a test table with 500,000 sequentially and ...
Steve's user avatar
  • 313
0 votes

How to set up locks to prevent stale data being written

Architecturally- volume of writes .. maybe you should find a queuing service to serialise those & stream them in, rather than having multiple writers? And having queued your write, queue a request ...
simon coleman's user avatar
1 vote
Accepted

Transaction management work under Instance or database

I remember from university that: By Default, doing Insert, Delete and update on 2 or more data sources can't be participant under a transaction This sounds like it was taken out of context, because ...
J.D.'s user avatar
  • 37.1k
-2 votes

Transaction management work under Instance or database

If you want to do two changes and the second one should not touch the first - just separate them. Insert into Northwind.dbo.Categories ([CategoryName], [Description]) values ('New Category', '...
White Owl's user avatar
  • 762

Top 50 recent answers are included