I have an INSERT statement that is eating a hell of a lot of log space, so much so that the hard drive is actually filling up before the statement completes.
The thing is, I really don’t need this to be logged as it is only an intermediate data upload step.
For argument’s sake, let’s say I have:
- Table A: Initial upload table (populated using
bcp, so no logging problems) - Table B: Populated using
INSERT INTO B from A
Is there a way that I can copy between A and B without anything being written to the log?
P.S. I’m using SQL Server 2008 with simple recovery model.
From Louis Davidson, Microsoft MVP:
If you don’t want to use SSIS, the point still applies to drop all of your constraints and use the
BULK LOGGEDrecovery model. This greatly reduces the logging done onINSERT INTOstatements and thus should solve your issue.http://msdn.microsoft.com/en-us/library/ms191244.aspx