cancel
Showing results for 
Search instead for 
Did you mean: 

simple update script

Former Member
0 Kudos

Hi Expert

I want to write a simple execute script as below and run as a scheduler every week so can you tell me how can make a bat file and place in weekly scheduling

backup in windows 2003

Use <DBNAME>

EXEC sp_updatestats

go

regards

Piroz

Accepted Solutions (1)

Accepted Solutions (1)

clas_hortien
Employee
Employee
0 Kudos

Hi,

you can easily run such a short script via:

osql -S<SQL Server Instance> -E -Q"use <SID> exec sp_updatestats"

This line can be added to any Windows command script and will execute

sp_updatestats against the given database.

Why you don't use the SQL Agent for doing this ? He is designed for running scheduled task on he databases ?

Regards

Clas

former_member193399
Active Participant
0 Kudos

Do you have any reason to update the statistics? SAP does not recommends to turn the "Auto Update statistics - On" and it is set to ON as part of the installation.

Thanks,

RT

Former Member
0 Kudos

Hi

Thanks very good and helpful solution

thanks

Answers (0)