Home > Archive > MS SQL Server > August 2005 > CREATE STATISTICS - use...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author CREATE STATISTICS - use...
HarrySmith

2005-08-31, 3:23 am

What is the use of running the command "CREATE STATISTICS"?
SQL 2K.
Thanks,
Harry


Hari Prasad

2005-08-31, 3:23 am

Hi,

You can use the CREATE STATISTICS command to create statistics on nonindexed
columns. Also, you can execute
the sp_createstats stored procedure, which creates single-column statistics
for all eligible columns for all user tables in the current database.

Thanks
Hari
SQL Server MVP


"HarrySmith" < HarrySmith_56@hotmai
l.com> wrote in message
news:u2UUTBdrFHA.3604@tk2msftngp13.phx.gbl...
> What is the use of running the command "CREATE STATISTICS"?
> SQL 2K.
> Thanks,
> Harry
>
>



Mike Hodgson

2005-08-31, 3:23 am

Further to Hari's post, statistics are used by the query optimiser when
it's calculating the best possible way to access the data you're after.
If you're after more info about stats, this whitepaper is really good (I
just read it last week):
Statistics Used by the Query Optimiser in Microsoft SQL Server 2005
<http://www.microsoft.com/technet/pr...5/qrystats.mspx>

It talks specifically about SQL 2005 but the concepts are mostly related
pretty closely to SQL 2000 too.

--
*mike hodgson*
blog: http://sqlnerd.blogspot.com



Hari Prasad wrote:

>Hi,
>
>You can use the CREATE STATISTICS command to create statistics on nonindexed
>columns. Also, you can execute
>the sp_createstats stored procedure, which creates single-column statistics
>for all eligible columns for all user tables in the current database.
>
>Thanks
>Hari
>SQL Server MVP
>
>
>"HarrySmith" < HarrySmith_56@hotmai
l.com> wrote in message
>news:u2UUTBdrFHA.3604@tk2msftngp13.phx.gbl...
>
>
>
>
>
>


HarrySmith

2005-08-31, 8:23 pm

Thank you very much to both of you.
Harry

"Mike Hodgson" <mike.hodgson@mallesons.nospam.com> wrote in message news:eFgPIQerFHA.3884@TK2MSFTNGP11.phx.gbl...
Further to Hari's post, statistics are used by the query optimiser when it's calculating the best possible way to access the data you're after. If you're after more info about stats, this whitepaper is really good (I just read it last week):
Statistics Used by the Query Optimiser in Microsoft SQL Server 2005

It talks specifically about SQL 2005 but the concepts are mostly related pretty closely to SQL 2000 too.

--
mike hodgson
blog: http://sqlnerd.blogspot.com



Hari Prasad wrote:
Hi,

You can use the CREATE STATISTICS command to create statistics on nonindexed
columns. Also, you can execute
the sp_createstats stored procedure, which creates single-column statistics
for all eligible columns for all user tables in the current database.

Thanks
Hari
SQL Server MVP


"HarrySmith" < HarrySmith_56@hotmai
l.com> wrote in message
news:u2UUTBdrFHA.3604@tk2msftngp13.phx.gbl...
What is the use of running the command "CREATE STATISTICS"?
SQL 2K.
Thanks,
Harry





Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com