Link to home
Start Free TrialLog in
Avatar of Robb Hill
Robb HillFlag for United States of America

asked on

SQL Cleanup on a table ( SQL 2014)

I have a table with 10534510 records.

This is a log table and is hooked into many systems during normal business hours...heck it might even have things logging to it at night...system jobs etc.

I need to truncate this table.

I am not the sql manager on this box...as its housed in a remote location.

I wanted to get a laundry list of things I need to think about before I do this..so I prevent any mess ups.

Should I back up this table as a first precaution.
Should I put the database in any status?
if the table is called log....would I just truncate table from db

Should any cleanup on the db be done after wards....shrink...indexin...etc.


Please assist.
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robb Hill

ASKER

Ok so not much here except the backup.

Are you telling me to go out to the database and see if I can drop the table and create...If I do that...would that not drop the table...sorry if this sounds dumb..but I do not want to lose the table when Im testing if I have appropriate rights.

Finally ..yes we should have a purge process and will be putting something in place for this.  

My manually run here will be the beginning of the annual purge:)

In other words I will be doing this manually a few times ...and then buildign a process as this would have to be deployed to 100s of remote locations....not as easy as managing on an internal system.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I specified in my post that he has to rename the PK, the FKs and the defaults. He will also do whatever suits him best space wise.
Thank you both - I appreciate all the thought into the question!