?
Solved

How to automatically delete data from database

Posted on 2009-06-29
4
Medium Priority
?
429 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 1000 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 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 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