Listing 2: Script to Determine Whether Write Cache Is Enabled /* ** Run this script twice: once with BEGIN TRAN/COMMIT TRAN, then once without them. */ CREATE TABLE test_disk_cache (c varchar(255) null) GO SET nocount on GO DECLARE @i int, @j int, @t datetime SELECT @t = getdate(), @i = 0 WHILE (@i < 200) BEGIN BEGIN TRAN -- Turn this on and off. SELECT @j = 0 WHILE (@j < 100) BEGIN INSERT test_disk_cache values(replicate('x', 100)) SELECT @j = @j + 1 END COMMIT TRAN -- Turn this on and off. SELECT @i = @i + 1 END SELECT datediff(second, @t, getdate()) GO