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 Development (2000)
 Shrink Database base on specific Schedule

Author  Topic 

farshad
Starting Member

10 Posts

Posted - 2004-06-09 : 02:18:28
Hi

I want to know what is command that i add to the Query Analyzer until
i tell to the database that it Shrink my DB every 1 day

I know it can be done from all Tasks > Shrink Database ..

i want to know how can i schedule the shrink process
The command is this : DBCC SHRINKDATABASE
But i want to know the Code commands for that for using in Query Analyzer that i can schedule the shrink process


Thanks

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-06-09 : 02:43:37

Create a job in the SQL Server agent. This will shrink the DB as often as you want.

Tim
Go to Top of Page

farshad
Starting Member

10 Posts

Posted - 2004-06-09 : 03:25:40
how can i creat a job
using the Query Analyzer

Thanks
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-06-09 : 19:11:23
Check out BOL.

The sp's you need are:

Execute sp_add_job to create a job.
Execute sp_add_jobstep to create one or more job steps.
Execute sp_add_jobschedule to create a job schedule.

HTH,

TIm
Go to Top of Page
   

- Advertisement -