SQL Server - Distribution of Data - 2

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

Thanks for replying my message.

A1. It is not feasible since that process takes much time.

A2. I mean SHOW_STATISTICS. But, I could not store the results into temp table because "dbcc show_statistics" command returns more than one result set.

A3. Unfortunately, that link did not help.

Kind regards, Fuat.

>Q1. Is it possible to determine the distribution of one column in >another column? > >A1. Not by using DBCC SHOW_STATISTICS. DBCC SHOW STATISTICS shows >the >distribution based on a single column, but you can query like so: > >select c1, count (*) as c1Count >from TX >where c2 between date1 and date2 >group by c1

>Q2. How can I access (store the result in a structure e.g. temp >table) the result DBCC SHOW_CONFIG command? > >A2. There is no DBCC SHOW_CONFIG command, but you can store the >results of some (but not all) DBCC commands by using one of the >following two methods. > >Q3. How can I interpret the value in sysindexes.statblob attribute? > >A3. The statblob column is basically what you get when you run DBCC >SHOW_STATISTICS. Specifically it contains the steps and density >information. You can read more about it at us/dnsql2k/html/statquery.asp.

-- Anonymous, July 02, 2001

Answers

Fuat,

I have to stick with my answer on Q1. Presuming that you have a clustered or non-clustered index on the c2 and c1 columns, to determine counts like you desire, you will have to create a query that does an index scan of some sort (either clustered or non- clustered). If that takes too long, the answers to the other questions are moot.

Good Luck,

Eric

-- Anonymous, July 02, 2001


Moderation questions? read the FAQ