I'm looking for a way to periodically (e.g. weekly) run some SQL statements in a database to delete old data. As far as I can see, there are (at least) two ways to do this:
- using a "Maintenance Plan" and a "Execute T-SQL Statement Task"
- using an "SQL Server Agent Job" and specify the statements in a "Step" of that job
My question is: what is the difference between these two possibilities and which one should I use for my task?