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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 deleting tables bulk-logged mode

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 mode
2nd . Delete the useless information
3rd . Put the db in full mode again

I 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 Master
ALTER DATABASE db_name SET RECOVERY BULK_LOGGED

But 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.
Go to Top of Page

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 anyway

The Padrón peppers itch and other no
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -