What are the ways to code efficient transactions?
Do not ask for an input from a user during a transaction. Get all input needed for a transaction before starting the transaction. Transaction should be atomic Transactions should be as short and small as possible. Rollback a transaction if a user intervenes and re-starts the transaction. Transaction should involve a small amount of data as it needs to lock the number of rows involved. Avoid transactions while browsing through data.
Read More..   [92 clicks]
Published under: SQL Server Interview Questions · · · ·