Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 23rd, 2003, 10:32 AM
aliaga61 aliaga61 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 73 aliaga61 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 56 m 52 sec
Reputation Power: 6
automated procedure in sql server

i'm trying to set up a table in sql server that will automatically update based on the date. basically, i want to display a list of dates for a year, given a set interval. when one date passes, i want its status set to inactive, and a new date added with a status of active. i would like this to run every day and check for new dates.

do i need to set up a trigger? a stored procedure?

can someone point me in the right direction, and maybe give me some information to check out? thanks.

Reply With Quote
  #2  
Old October 23rd, 2003, 03:14 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
You could create a "job" that is scheduled to run on a daily basis, say at midnight. The job could contain a step that runs a stored procedure or a step that includes your actual SQL query to change the values in the table.

To create a job, open up SQL Server and go to Management->SQL Server Agent->Jobs. Right-click on the right-hand pane and select New Job.

Hope this helps.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > automated procedure in sql server


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT