------------------------------------------------ -- Switch in Single User mode ------------------------------------------------ ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE ------------------------------------------------ -- Delete replication transactions -- currently running on the published database ------------------------------------------------ USE DatabaseName go sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1 go ------------------------------------------------ -- Log Shrink ------------------------------------------------ DBCC SHRINKFILE(DatabaseLogName, 100) -- If there is no effect, you can execute the following commands: -- BACKUP LOG DatabaseName WITH TRUNCATE_ONLY -- DBCC OPENTRAN(DatabaseName) ------------------------------------------------ -- Switch on Multi User mode ------------------------------------------------ ALTER DATABASE DatabaseName SET MULTI_USER WITH ROLLBACK IMMEDIATE ------------------------------------------------ -- RESTART ------------------------------------------------ USE DatabaseName exec sp_replrestart