Using stored procedures for performance benefit

Note: This topic applies primarily to on-premises environments. Multi-tenant cloud customer adminstrators cannot perform this procedure.

To maximize efficiency and improve the performance of your system, these stored procedures should be run regularly:

  • sp_updatestats: To update statistics for all the tables in a database, run this SQL-supplied stored procedure regularly. You can get more information about this stored procedure from the SQL online help.
  • SLServerRestartSp: This stored procedure runs and performs general cleanup whenever the database server is restarted, as no one is logged in at that time.
  • PurgeNextKeysSp: Run this stored procedure to clean up the NextKeys table. NextKey records are inserted but are never updated to get concurrency. This stored procedure cleans out the extra rows.
    Note: Do not run this utility while anyone is using the system. The utility locks users out, so you should verify that everyone is logged out of the system before running this utility.