views:

27

answers:

2

When we develop an ASP.NET client site, we deploy a SQL Server Express database along with it. We need to run a clean-up script to check for records older than n. hours, but unfortunately I cannot schedule a job do to the limitations of SQL Express. Are there any other alternatives or suggestions for automating clean-house that anyone may have had experience implementing?

A: 

You could setup a Windows Scheduled Task that hits an ASP.NET page to do the clean up.

RedFilter
Or a Windows scheduled task that *just* performs the clean up (no page hittage needed)
onupdatecascade
I would use the web page because a) let's you run remotely if you need to, and b) keeps your code in the same place...
RedFilter
+4  A: 

Use a conversation timer and run the maintenance from an activated procedure. Sign the procedure for cross-db or server wide access.

The big advantage is that is self contained in the database and survives across database copy and backup/restore operations (a scheduled 'job' will execute after a restore on a new system).

Remus Rusanu
+1, interesting approach
Rubens Farias
yeah *very* interesting - like it!
Matt Whitfield