SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Shrink Database base on specific Schedule
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

farshad
Starting Member

10 Posts

Posted - 06/09/2004 :  02:18:28  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

Australia
1242 Posts

Posted - 06/09/2004 :  02:43:37  Show Profile  Visit timmy's Homepage  Reply with Quote

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 - 06/09/2004 :  03:25:40  Show Profile  Reply with Quote
how can i creat a job
using the Query Analyzer

Thanks
Go to Top of Page

timmy
Flowing Fount of Yak Knowledge

Australia
1242 Posts

Posted - 06/09/2004 :  19:11:23  Show Profile  Visit timmy's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000