First - sorry if this is a duplicate question. Thougt that I had posted this earlier, but cannot find it anywhere on the forum.
SQL 2008 R2. Trying to get Minimal Logging working for an INSERT INTO SELECT FROM. My test destination table is empty and has no indexes.
If I use the WITH (TABLOCK) it seems use minimal logging. But if I remove the TABLOCK and use the following two statements to try and "turn on" minimcal logging it does not use Minimal Logging.
DBCC TRACEon(610); EXEC sp_tableoption table1,'table lock on bulk load',1
I am testing my minimal logging success by runnint the following query and comparing the log record sizes and number of log records for the same Table1. I assume this is the correct way to test.
SELECT table1' AS DBName,
MAX([Log Record Length]) as MaxRecLen,
SUM([Log Record Length]) AS SumRecLen,
COUNT(*) as [CountRec]
FROM fn_dblog(null, null)
where allocunitname like 'dbo.table1%';