Solved

How to automatically delete data from database

Posted on 2009-06-29
4
382 Views
Last Modified: 2013-12-26
I need a function that checks and clean my database of old data, e g if its older than 4 months delete it.

I have Sql Management Server Studio Express so I can't do it with jobs.

Is windows service or webservice the way to go? or maybe windows schedule tasks

I need help to get started, so please give me some examples.

My next task is to be able in my aspx page to set dates for automatic email reminders for people that have not yet registered for different events.
0
Comment
Question by:mattegol
4 Comments
 
LVL 3

Accepted Solution

by:
sandip-mishra earned 250 total points
Comment Utility
hi.. i am doing the same thing ......

I have created a console application and sheduled it. After every 24 hours it runs through the datatable and deletes the records that is 6 months old.

Hence you can use a windows application and schedule it.

Regards

Sandip Mishra

(web site signature removed by Moderator)
0
 

Author Comment

by:mattegol
Comment Utility
Great!

This is exactly what I need..

Can you please give me an example of this or give me a how to link or guide me or something, I have never done this before and I'm in a hurry.

Regards
Mats
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
Comment Utility
if you are still interested...
you don't need to create/compile a application.

you can use sqlcmd.exe (which comes with sql server 2005+), which has a parameter to execute a sql statement. putting that into a plain .bat file (with notepad editor), and schedule that .bat in your windows scheduler, and you are done.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Read about achieving the basic levels of HRIS security in the workplace.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now