(DIR) Return Create A Forum - Home --------------------------------------------------------- ExcelSoft Database Professionals (HTM) https://esdbp.createaforum.com --------------------------------------------------------- ***************************************************** (DIR) Return to: Scripts ***************************************************** #Post#: 14-------------------------------------------------- Update statistics in a smarter way By: srinivasma_exceldbp Date: February 27, 2014, 2:02 am --------------------------------------------------------- Updates statistics in a smart way . It will not update already up to date statistics Provide appropriate parameters USAGE 50, @threshold = 500000,@flag = 'I' Description statistics Server Database Input Parameters: days between today and lastupdated statistics date if difference is above , statistics will be updated @percentage = Percenatge of (rows sampled/ no of rows ) * 100 if this percentage <= to the supplied value , statistics will be updated @threshold -- for large tables updating statistics is time consuming. if totalnoofrows > @threshold the update statistics will run with sampling @action = 'I' - Run update statistics 'L' - Only Run , Don't Update Statistics *****************************************************