Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cidmi.dovic
Yak Posting Veteran
53 Posts |
Posted - 2007-12-03 : 10:51:12
|
Hi, I want to delete some tables from a database and I need to make it once a week and advoid the transaction log to increase excessiely. I'm thinking in execute a Job once a week when the db is not used and:1st . Put the db in Bulk-Logged mode2nd . Delete the useless information3rd . Put the db in full mode againI was thinking on create a stored procedure for this and the job will be a simple call to this sp. In order to switch the database to bulk-logged mode I need to execute :USE MasterALTER DATABASE db_name SET RECOVERY BULK_LOGGEDBut I can't do it inside a SP, using USE is ot allowed on it.Any idea?Thanks a lot.The Padrón peppers itch and other no |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2007-12-03 : 11:00:47
|
set a job with 2 steps. |
 |
|
cidmi.dovic
Yak Posting Veteran
53 Posts |
Posted - 2007-12-03 : 11:03:22
|
quote: Originally posted by RickD set a job with 2 steps.
Actually 3 steps, finally I need to put the db on full mode again.I thought to make it but I didn't like the solution...Thank anywayThe Padrón peppers itch and other no |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-12-03 : 22:42:54
|
Delete rows in small batches and backup log in between. |
 |
|
|
|
|