Behaviour of update statistics in case when is tra

2019-07-16 21:50发布

问题:

In our application we are running query 'update statistics with sample 30 percent'.

Our system design is such that we have to use update statistics query once a day to improve query performance.

We are setting autocommit as false, running 'update statistics' and then some queries which are failing causing a connection rollback.

In this case does 'update statistics' query rollback as well? Should I again run update statistics command the second time? Does 'update statistics' auto commit, or should I commit after 'update statistics' and then execute the remaining queries?

Thanks.

回答1:

Update statistics will rollback back with the rest of the transaction.