Solved

How to automatically delete data from database

Posted on 2009-06-29
4
404 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
ID: 24734664
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
ID: 24734692
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
ID: 24930132
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

785 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