Learn scripting statistics for read-only database use from TempDB, then make them permanent so they survive a SQL Server restart.
SQL SERVER – Location of Statistics Before and After Database is Marked as a Read-Only
Where do old statistics go when a database becomes read-only? The location of statistics created before the change stays the same, and they remain permanent.
SQL SERVER – How to Script Statistics from SSMS? – Scripting Statistics is Disabled in SSMS
Trying to script statistics in SSMS but the option is always disabled, even outside read-only databases? Here is why it happens.
SQL SERVER – Statistics for Read-Only Database are in TempDB
Statistics usually live in the same database as the table, so where do they go for a read-only database? The answer is TempDB. Here is how it works.
SQL SERVER – Find Details for Statistics of Whole Database
Need statistics of whole database in one view? My script uses DMVs instead of the deprecated sp_helpstats and shows each stat, column and last update.






