Analyse SQL Server histogram table -


is there way access histograms values in sql server sql command? easy see histogram of attribute using dbcc show_statistics, however, possible access histogram table in sql select command or in t-sql procedure/function?

i remember trick video of kimberley tripp,so quick search yielded below

 create table histogram (         [range_hi_key] sql_variant     ,   [range_rows] sql_variant     ,   [eq_rows] sql_variant     ,   [distinct_range_rows]  sql_variant     ,   [avg_range_rows] sql_variant     )  insert histogram exec ('dbcc show_statistics(''dbo.orders'',''_wa_sys_00000001_29572725'')  histogram') 

now can access table ..you can same stat_header , density_vector

references:
https://social.msdn.microsoft.com/forums/sqlserver/en-us/00a3fc6f-bc42-46da-9574-088522976fbb/dbcc-showstatistics-how-to-send-result-to-table?forum=sqltools


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -