locked
AUTOMATING TRANCATION RRS feed

  • Question

  • Hi,

    I have one senario like one of my database is restricted to 100gb. So when ever database reaches to 100gb two of my database tables should be truncated to release some space.

    Some one please help me how to automate this senario.

     

    Thanks,

    Goutham


    gouthamraj
    • Moved by Tom Phillips Tuesday, October 11, 2011 9:32 PM TSQL question (From:SQL Server Database Engine)
    Tuesday, October 11, 2011 8:38 PM

Answers

All replies

  • I think, the best approach would be creating a daily job or on specific time period run a job which is checking how much is your DB size if it passed like 95GB or something like that then Truncate tables that you are looking for.

    I would suggest to this in OFF hours, if users are using those two tables and you do not want to LOCK users.


    Best Wishes, Arbi --- MCC 2011; Please vote if you find this posting was helpful or Mark it as answered.

    Tuesday, October 11, 2011 9:58 PM
  • Arbi,

    Thank you very much for your reply. Same thing I have explained to my lead regarding creating a daily job on specific time period. But he does't want to run a job for specific time period. He want automated process when ever db reaches near to 100gb tables should be truncated.

    Let me know if you have any idea about this.

     

    Thanks,

    Goutham


    gouthamraj
    Tuesday, October 11, 2011 10:14 PM
  • Goutham,

    You can check Service Broker and Notification Services.

     


    Best Wishes, Arbi --- MCC 2011; Please vote if you find this posting was helpful or Mark it as answered.
    • Marked as answer by gouthamraj Wednesday, October 12, 2011 2:47 PM
    Tuesday, October 11, 2011 10:21 PM