[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

Run Stored Procedure as a Scheduled Job

bubbles

3/27/2007 12:53:00 AM

SQL Server 2005 Enterprise version.

I have a stored procedure that executes several stored procedures.
The SPs were set up individually for ease of debugging, then run as a
batch.

Individually and as a batch, they run fine.

How do I set up this SP to run as a scheduled batch? I need to run
this batch
every night.

Thanks,
Bubbles

5 Answers

EMartinez

3/27/2007 2:20:00 AM

0

If I understand you correctly, you can either run the stored procedure
as a job via the SQL Agent or you can use OSQL to call the stored
procedure in a batch file and then use Scheduled Tasks to execute it
(Scheduled Tasks are accessible via: Start Menu -> Programs ->
Accessories -> System Tools -> Scheduled Tasks). You should be able to
navigate to the batch file and in advances setting set up a schedule.
Hope this helps.

Regards,

Enrique Martinez
Sr. Software Consultant


bubbles wrote:
> SQL Server 2005 Enterprise version.
>
> I have a stored procedure that executes several stored procedures.
> The SPs were set up individually for ease of debugging, then run as a
> batch.
>
> Individually and as a batch, they run fine.
>
> How do I set up this SP to run as a scheduled batch? I need to run
> this batch
> every night.
>
> Thanks,
> Bubbles

bubbles

3/27/2007 2:30:00 AM

0

I could run the SPs from SQL Server Management Studio, but
unsuccessful in
setting up a job to run at scheduled time.

I could (and already did) set up a maintanance task to back up the
databases,
and they ran as scheduled.

How do I set up a stored procedure to run at a scheduled time?

Thanks,
Bubbles


On Mar 27, 10:20 am, "EMartinez" <emartinez....@gmail.com> wrote:
> If I understand you correctly, you can either run the stored procedure
> as a job via the SQL Agent or you can use OSQL to call the stored
> procedure in a batch file and then use Scheduled Tasks to execute it
> (Scheduled Tasks are accessible via: Start Menu -> Programs ->
> Accessories -> System Tools -> Scheduled Tasks). You should be able to
> navigate to the batch file and in advances setting set up a schedule.
> Hope this helps.
>
> Regards,
>
> Enrique Martinez
> Sr. Software Consultant

EMartinez

3/27/2007 2:38:00 AM

0

On Mar 26, 9:29 pm, "bubbles" <bubbles....@hotmail.com> wrote:
> I could run the SPs from SQL Server Management Studio, but
> unsuccessful in
> setting up a job to run at scheduled time.
>
> I could (and already did) set up a maintanance task to back up the
> databases,
> and they ran as scheduled.
>
> How do I set up a stored procedure to run at a scheduled time?
>
> Thanks,
> Bubbles
>
> On Mar 27, 10:20 am, "EMartinez" <emartinez....@gmail.com> wrote:
>
> > If I understand you correctly, you can either run the stored procedure
> > as a job via the SQL Agent or you can use OSQL to call the stored
> > procedure in a batch file and then use Scheduled Tasks to execute it
> > (Scheduled Tasks are accessible via: Start Menu -> Programs ->
> > Accessories -> System Tools -> Scheduled Tasks). You should be able to
> > navigate to the batch file and in advances setting set up a schedule.
> > Hope this helps.
>
> > Regards,
>
> > Enrique Martinez
> > Sr. Software Consultant

Do you have the appropriate permissions to access and create Jobs?

Enrique Martinez
Sr. Software Consultant

bubbles

3/27/2007 2:43:00 AM

0

Had set myself up as an operator.


On Mar 27, 10:38 am, "EMartinez" <emartinez....@gmail.com> wrote:
> On Mar 26, 9:29 pm, "bubbles" <bubbles....@hotmail.com> wrote:
>
> Do you have the appropriate permissions to access and create Jobs?
>
> Enrique Martinez
> Sr. Software Consultant- Hide quoted text -
>
> - Show quoted text -


Tibor Karaszi

3/27/2007 6:47:00 AM

0

If the job fails, we need error messages to troubleshoot. Specify an output file for the job step
and post back the error messages found in this.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/d...
http://www.solidqualitylea...


"bubbles" <bubbles.one@hotmail.com> wrote in message
news:1174963404.575053.155750@p77g2000hsh.googlegroups.com...
> Had set myself up as an operator.
>
>
> On Mar 27, 10:38 am, "EMartinez" <emartinez....@gmail.com> wrote:
>> On Mar 26, 9:29 pm, "bubbles" <bubbles....@hotmail.com> wrote:
>>
>> Do you have the appropriate permissions to access and create Jobs?
>>
>> Enrique Martinez
>> Sr. Software Consultant- Hide quoted text -
>>
>> - Show quoted text -
>
>