Automatic Update of Microsoft SQL Server Statistics


If you monitor the performance of Microsoft SQL server in your tests and collect SQL performance counters statistics, you may sometimes need to update server statistics. This can be done automatically if you create a job in Microsoft SQL Server Management Studio and define the necessary scheduling options.

Note that usually MSSQL server statistics is updated automatically and you will not need to create any special jobs. This procedure is required only in case you receive wrong results using the default settings, e.g. you see that received values are not updated, or they are equal to 0, or you do not receive any values at all. In this case we recommend adding a new job for regular update. Below is the instruction how to do it.

Open Microsoft SQL Server Management Studio, select SQL Server Agent -> Jobs, right-click to get the menu and choose the New Job... option on the menu.



In the displayed New Job dialog select the General tab and enter a name for the new schedule.



Then select the Steps tab and click the New... button. In the displayed New Job Step dialog enter a step name and type sp_monitor in the Command field. Make sure that the option master is selected in the Database combo-box. Click OK.



Select the Schedules tab and click the New... button. Enter a name for the new schedule. In the Occurs combo-box select "Daily", "Weekly" or "Monthly". Then specify how often to refresh the server statistics (Recurs every options) and click OK.



Your new job will be added to the list of jobs. Now the update of Microsoft SQL server statistics will be done automatically according to the scheduling options you have just specified.

Next page