sql >> Database >  >> RDS >> Sqlserver

Hoe weet ik in SQL Server welke transactiemodus ik momenteel gebruik?

IF @@TRANCOUNT = 0 PRINT 'No current transaction, autocommit mode (default)'
ELSE IF @@OPTIONS & 2 = 0 PRINT 'Implicit transactions is off, explicit transaction is currently running'
ELSE PRINT 'Implicit transactions is on, implicit or explicit transaction is currently running'

Ik denk niet dat er een manier is om te bepalen of de huidige transactie expliciet of impliciet is gestart. Deze code probeert dus te raden:als IMPLICIT_TRANSACTIONS UIT staat, wordt aangenomen dat de transactie expliciet wordt gestart.

MSDN-referenties:



  1. Print de naam van alle activiteiten met geen maximum of minimum aantal deelnemers

  2. Verdien geld met ongebruikte spullen:een gegevensmodel in de deeleconomie

  3. MySQL-installatie:FOUT:kan de native extensie voor gem niet bouwen

  4. Bash-script om PostgreSQL te installeren - Werkt niet