Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Periodic run of stored procedure
Hi,

I have this stored procedure that I need to run daily, how do I do
this?

Thanks,
Mike
<><


Report this thread to moderator Post Follow-up to this message
Old Post
brogdonm
12-20-05 01:25 AM


Re: Periodic run of stored procedure
One method is to schedule the proc execution using a SQL Server Agent job.
You can create a job using the EM or SSMS GUI.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"brogdonm" <Brogdons@gmail.com> wrote in message
news:1135034300.442082.324910@g14g2000cwa.googlegroups.com...
> Hi,
>
> I have this stored procedure that I need to run daily, how do I do
> this?
>
> Thanks,
> Mike
> <><
>



Report this thread to moderator Post Follow-up to this message
Old Post
Dan Guzman
12-20-05 01:25 AM


Re: Periodic run of stored procedure
Is it a bad idea to do something like

WHILE (1<>0)
BEGIN
WAITFOR TIME '04:00'

Report this thread to moderator Post Follow-up to this message
Old Post
brogdonm
12-20-05 01:25 AM


Re: Periodic run of stored procedure
"brogdonm" <Brogdons@gmail.com> wrote in message
news:1135036649.313243.99790@f14g2000cwb.googlegroups.com...
> Is it a bad idea to do something like
>
> WHILE (1<>0)
> BEGIN
>           WAITFOR TIME '04:00'
>            .
>            .
>            .
> END
>
> It seems like that would work as long as WAITFOR actually yields the
> processor.

There's far better ways of doing this, as Dan suggested, SQL Server agent is
the way to do it.


>
> Mike,
> <><
>



Report this thread to moderator Post Follow-up to this message
Old Post
Greg D. Moore \(Strider\)
12-20-05 08:23 AM


Re: Periodic run of stored procedure
I've seen WAITFOR DELAY used in order to execute a proc at very frequent
intervals (e.g. every minute or less).  However, a scheduled job is a better
fit for less frequent executions since that gives you job history and
failure notification.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"brogdonm" <Brogdons@gmail.com> wrote in message
news:1135036649.313243.99790@f14g2000cwb.googlegroups.com...
> Is it a bad idea to do something like
>
> WHILE (1<>0)
> BEGIN
>          WAITFOR TIME '04:00'
>           .
>           .
>           .
> END
>
> It seems like that would work as long as WAITFOR actually yields the
> processor.
>
> Mike,
> <><
>



Report this thread to moderator Post Follow-up to this message
Old Post
Dan Guzman
12-20-05 08:23 AM


Re: Periodic run of stored procedure
Thanks guys I will look into that now that I am off of my Christmas
Vacation. I really appreciate all of the replies.


Report this thread to moderator Post Follow-up to this message
Old Post
brogdonm
12-27-05 08:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 12:38 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006