I have inherited a website and database and after having it for a while now I realise that alot of the data within the database is redundant and that the accounts holding that data are no longer being accessed.
I would like to be able to delete any records from the account table older than 90 days and with them any associated records from all other tables.
I am new to MS SQL databases and have only been able to get as far as deleted records from the account table based on the lastlogin field.
Any help on coding the SQL statement for this delete would be very much appreciated.
If possible I would like to be able to run this automatically every month as a stored procedure, again I know very little about these but belive something of this nature is possible.
A full database diagram can be seen here : http://www.twfarmreport.com/full-database-diagram.jpg
View Complete Post