Link to home
Start Free TrialLog in
Avatar of mallio
mallio

asked on

how to temporarily disable transaction log

Hi there!  Is it possible to disable transaction logging for a particular query?  I have a couple stored procs that do some inserts/deletes from some temp tables that aren't too important - but their transactions still add to our transaction log, which occasionally fills our disk space up.  Is there a command I can call at the top of each stored proc to disable any transactions temporarily for those few queries?

Thanks for any help!
Avatar of higginspi
higginspi

IF MS SQL Server, try the "Dbcc shrinkfile" command with the truncateonly option.  See BOL for syntax.  (Search for dbcc shrinkfile).
It won't disable the log files, but it will empty them for you.
ASKER CERTIFIED SOLUTION
Avatar of gletiecq
gletiecq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Guy Hengel [angelIII / a3]
Combining all of the above:
NO, you cannot do this in 1 database
YES, you can do this in 2 databases

In fact, if you have some tables that are not important or can easily be restored, create them in a separate database which you put in NOLOG mode or where the logging mode is configured as you don't matter the transaction log. This depends very much on the RDMBS you use...
The other tables stay in your primary database.

CHeers
recommend split:  gletiecq and rherguth