Click here to Skip to main content
14,640,725 members
Rate this:
Please Sign up or sign in to vote.
See more:
I need to update a SQL database every day in terms of deleting expired entries.Therefore, I have to fields in the db named 'date' and 'expired' (which is the actual date ... How do I get that again?).
[no name] 16-Aug-13 7:32am
How do you get "what" again? Use SELECT to select records, UPDATE to update records and DELETE to delete records.
ZurdoDev 16-Aug-13 7:36am
What's the problem?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

If you are using SQL Server, then SQL Server provides an option to define a job. You can define a job and write that query which you execute on daily basis but in a generic way that it can automatically check for the date of the data to be deleted. After you are done, set the settings of that job to be run once a day. Job of Sql Server runs like a service and by setting it run once in a day you are automating your process :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100