Solved

How to automatically delete data from database

Posted on 2009-06-29
4
419 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 143

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 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