SQL Script for UPDATE STATISTICS

Hi Guys, Can anybody provide me with SQL Script ( A basic list of all standard tables with their releted indexes. ) For running UPDATE STATISTCS on our Navision SQL Server. Our client wants to look at the stats as they feel the performance is slow. We are using Navision 3.70. Thanks Kmbhartiya

Well, actaully you don’t need to create script where all tables and indexes are “listed” to doe CREATE STATISTICS or UPDATE STATISTICS. The easiest way is to create/update the statistics with using a “SQL Maintenace Plan”, there you can activate the option “Update Statistics”. The higher the sample rate, the better the statistics - but the more space is used and the longer is the runtime. Hope this could help … Regards,

Moved to the SQL Forum

SQL Server comes with a system stored procedure that updates statistics for all tables, called “sp_updatestats”. Open Books Online (Start, All programs, SQL Server. For SQL Server 2000 it should be right there, for SQL Server 2005, it’s in the documentation folder), and search for “sp_updatestats”. Like Jorg says, you can add a call to this stored procedure to a maintenance job.