Home All Groups Group Topic Archive Search About

Run a Maint Plan from a bat file?



Author
1 May 2007 5:33 PM
donsql22222
Is it possible to run a Maintenance Plan Job called from a bat file?

I need to have a Perl script finish running its job before the Maintenance
Plan is called so there's no interference because of the locked tables while
doing the reindexing.

I can run the Perl script from a bat file so it would be great if I could
have the 2nd line of the bat file call the Maint Plan.

SQL 2000

Any insight or suggestions appreciated.
Don

Author
1 May 2007 5:45 PM
Tibor Karaszi
Sure. You can call OSQL.EXE and in there execute sp_start_job.

Show quoteHide quote
"donsql22222" <donsql22***@discussions.microsoft.com> wrote in message
news:4E296E58-70FA-4E0A-BDE3-3D673B462763@microsoft.com...
> Is it possible to run a Maintenance Plan Job called from a bat file?
>
> I need to have a Perl script finish running its job before the Maintenance
> Plan is called so there's no interference because of the locked tables while
> doing the reindexing.
>
> I can run the Perl script from a bat file so it would be great if I could
> have the 2nd line of the bat file call the Maint Plan.
>
> SQL 2000
>
> Any insight or suggestions appreciated.
> Don
Are all your drivers up to date? click for free checkup

Author
1 May 2007 6:00 PM
donsql22222
ahhhh...beautiful!!

thx!
Don


Show quoteHide quote
"Tibor Karaszi" wrote:

> Sure. You can call OSQL.EXE and in there execute sp_start_job.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
>
> "donsql22222" <donsql22***@discussions.microsoft.com> wrote in message
> news:4E296E58-70FA-4E0A-BDE3-3D673B462763@microsoft.com...
> > Is it possible to run a Maintenance Plan Job called from a bat file?
> >
> > I need to have a Perl script finish running its job before the Maintenance
> > Plan is called so there's no interference because of the locked tables while
> > doing the reindexing.
> >
> > I can run the Perl script from a bat file so it would be great if I could
> > have the 2nd line of the bat file call the Maint Plan.
> >
> > SQL 2000
> >
> > Any insight or suggestions appreciated.
> > Don
>
>

Bookmark and Share