on 10-03-2007 3:43 AM
Hi Expert
Is there any command or way to update my old statistic dates every week
instead of selecting the table and view and run it manually
regards
Pp
U can schedule this action weekly from DB13 ..UpdateStats...No manual intervention required.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I usually keep the default settings on the database "update statistics" to on. This will update automatically behind the same of all the tables. But if you want to run manually try this:
Execute the following SQL in the management studio or query analyzer:
select 'update statistics ['+TABLE_SCHEMA+'].['+TABLE_NAME+'];'
from INFORMATION_SCHEMA.TABLES
where TABLE_TYPE='BASE TABLE'
The above will generate a result set which is nothing but a set of SQL statements to run update statistics for each table. Now copy and paste these from the results windows to the query window and execute it. I recommend running it in batch of 1000 though. Also make sure you run this in a scheduled downtime.
Alternative to this is creating a maintenance plan in SQL Server and use "update statistics task" and schedule the same.
I prefer taking backups, running dbcc checkdb and these kind of tasks to perform in the SQL Server rather than doing in the SAP. Let me know if this helps.
RT
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.