Troubleshooting Guide: Error 3908 — “Could Not Run BEGIN TRANSACTION” in SQL Server 2025
Why This Error Happens
This error occurs when the SQL Server database engine flags a database as being in Emergency Mode or detects it as structurally damaged, preventing any transactional activity from starting. This typically results from a corrupted transaction log, an incomplete recovery process after an unexpected shutdown, or physical corruption of the primary data file (.mdf). Because the database cannot guarantee ACID compliance in this state, SQL Server blocks all BEGIN TRANSACTION calls until the database is repaired and brought back online.
Step-by-Step Resolution Guide
Step 1: Verify the Current Database State
- Open SQL Server Management Studio (SSMS) or a query window and run the following to check the status:
SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName';
- Look specifically for
EMERGENCYorSUSPECTin thestate_desccolumn. - Check the SQL Server Error Log located at
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOGfor specific corruption messages (e.g., Error 823 or 824) that triggered the Emergency Mode flag.
Step 2: Attempt Database Repair via Emergency Mode
- If the database is already in Emergency Mode, set it to
SINGLE_USERto isolate it for repair:
ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
- Run the DBCC CHECKDB command with the repair option to attempt automatic fixes. Note that this may result in data loss for corrupted pages:
DBCC CHECKDB (YourDatabaseName, REPAIR_ALLOW_DATA_LOSS);
- Allow the process to run completely, as it may take significant time depending on database size.
Step 3: Restart the SQL Server Service (Windows Server 2025)
- Open the Services console by running
services.mscin the Windows 11/Server 2025 Run dialog. - Locate SQL Server (MSSQLSERVER) or the specific named instance.
- Right-click and select Restart to clear any stale locks or session handles the engine may have retained during the corruption event.
- If the service fails to restart, check the Windows System Event Viewer (
eventvwr.msc) under Windows Logs > Application for specific startup failures related to the Database Engine.
Step 4: Take the Database Back Online
- Once the repair command has successfully executed, revert the database to multi-user access:
ALTER DATABASE YourDatabaseName SET MULTI_USER;
- Attempt to run a standard
BEGIN TRANSACTIONcommand again to confirm the lock has been lifted.
Alternative or Verification Steps
- Verification: Run
DBCC CHECKDB (YourDatabaseName) WITH NO_INFOMSGS;again after the fix to ensure the integrity check returns zero allocation or consistency errors. - Alternative Solution: If
REPAIR_ALLOW_DATA_LOSSfails to bring the database out of Emergency Mode, restore the database from the last known good backup usingRESTORE DATABASE YourDatabaseName FROM DISK = 'BackupPath.bak' WITH RECOVERY;to ensure data integrity.