[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

SQL creating stored procedure that runs annually

I've never created a stored procedure.  I need some help on how to accomplish what I'm going for.

Basically, I need to have this procedure run every year on 09/30 at 11:59 pm.  All I want to do is this:

UPDATE tblDrivers SET intTPS = 0
UPDATE tblTPS SET intTPS = 0
0
gfedz
Asked:
gfedz
3 Solutions
 
cojdevCommented:
You will have to schedule the procedure to run with a job.
0
 
cfEngineersCommented:
open your query window and type this

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE UpdateTPSAndDrivers
AS
BEGIN
      SET NOCOUNT ON;
      UPDATE tblDrivers SET intTPS = 0
      UPDATE tblTPS SET intTPS = 0
END
GO
0
 
cfEngineersCommented:
This link can help you schedule a job.
http://msdn.microsoft.com/en-us/library/ms191439.aspx

0
 
JaseemKCommented:
The Step will be Transact SQL, with the correct database selected and your update statements in the Command section.

Set up the schedule as:
Name: give it a name
Schedule type: Recurring.
Freq.: Monthly frequency, the Last day of every 12 months.
Daily Freq.: Occurs once at 11.59.00
Duration: Start Date: 30/09/2011.
0
 
gfedzAuthor Commented:
Thank you all for your time.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now