Whenever we run a DELETE statement in SQL Server it's generating too many logs in log files(for one hour it's 200 GB). Is there any SQL hint that tells SQL Server that doesn't generate any log or minimal log?
Asked
Active
Viewed 99 times
0
-
https://stackoverflow.com/questions/24213299/how-to-delete-large-data-of-table-in-sql-without-log – Zeljka Mar 05 '20 at 09:34
-
4Are you deleting all the rows? If so, consider using `TRUNCATE`. If it's a significant amount, consider inserting the data you want to retain to a temporary object truncating, and then reinserting. Otherwise, use paging. You might, also, want to consider putting the database in `SIMPLE` mode; however, that doesn't stop the SQL Server logging; just that they're purged after the transaction is committed. Good luck. – Thom A Mar 05 '20 at 09:57
-
1@Larnu i think you meant "batching", not "paging" – SMor Mar 05 '20 at 12:24
-
I do, @SMor ; we'd run out of coffee when I posted that, my mind was on much more concerning matters. ;) – Thom A Mar 05 '20 at 12:27
-
@Larnu our transaction log sometimes takes 15 minutes to backup. When backup running, doit it affects all applications that use that database? – Imran Qadir Baksh - Baloch Mar 07 '20 at 11:31
-
If you want to understand how backups work, you should be asking on [DBA.se]. – Thom A Mar 07 '20 at 11:44