Thursday, March 22, 2012

CREATE STATISTICS - use...

What is the use of running the command "CREATE STATISTICS"?
SQL 2K.
Thanks,
HarryHi,
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@.hotmail.com> wrote in message
news:u2UUTBdrFHA.3604@.tk2msftngp13.phx.gbl...
> What is the use of running the command "CREATE STATISTICS"?
> SQL 2K.
> Thanks,
> Harry
>|||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 nonindexe
d
>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@.hotmail.com> wrote in message
>news:u2UUTBdrFHA.3604@.tk2msftngp13.phx.gbl...
>
>
>|||Thank you very much to both of you.
Harry
"Mike Hodgson" <mike.hodgson@.mallesons.nospam.com> wrote in message news:eFg
PIQerFHA.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 pre
tty 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@.hotmail.com> wrote in message
news:u2UUTBdrFHA.3604@.tk2msftngp13.phx.gbl...
What is the use of running the command "CREATE STATISTICS"?
SQL 2K.
Thanks,
Harrysql

No comments:

Post a Comment