<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.7.1" -->
<rss version="0.92">
<channel>
	<title>SQL Statistics</title>
	<link>http://www.sqlstatistics.com</link>
	<description>SQL Server Statistics</description>
	<lastBuildDate>Thu, 16 Jun 2011 19:13:06 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Can not ALTER COLUMN if it is used in INDEX, STATISTICS, PRIMARY KEY</title>
		<description>If I change a column to not nullable or shorten a column, I get the error:The altered column cannot be: 

A column with a text, image, ntext, or timestamp data type.

The ROWGUIDCOL for the table.

A computed column or used in a computed column.

A replicated column.

Used in an index, unless the ...</description>
		<link>http://www.sqlstatistics.com/can-not-alter-column-if-it-is-used-in-index-statistics-primary-key/</link>
			</item>
	<item>
		<title></title>
		<description>In most cases it is wise to let SQL Server automatically update statistics.
To turn on automatic updates for all statistics in a database, if not already on, execute the following statement:

USE master
EXEC sp_dboption 'MyDatabase', ' auto update statistics', 'true'
To turn on automatic updates for all statistics on a specific table, ...</description>
		<link>http://www.sqlstatistics.com/69/</link>
			</item>
	<item>
		<title>Query to get the list of Indexes and Statistics and when they were updated</title>
		<description>select
schemas.name as table_schema,
tbls.name as table_name,
i.name as index_name,
i.id as table_id,
i.indid as index_id,
i.groupid,
i.rowmodctr as modifiedRows,
(select max(rowcnt) from sysindexes i2 where i.id = i2.id and i2.indid &#60; 2) as rowcnt,
convert(DECIMAL(18,8), convert(DECIMAL(18,8),i.rowmodctr) / convert(DECIMAL(18,8),(select max(rowcnt) from sysindexes i2 where i.id = i2.id and i2.indid &#60; 2))) as ModifiedPct,
stats_date( i.id, i.indid ) as lastStatsUpdate,
'False' as ...</description>
		<link>http://www.sqlstatistics.com/query-to-get-the-list-of-indexes-and-statistics-and-when-they-were-updated/</link>
			</item>
	<item>
		<title>Query to get a list Statistics in the database (from sys.sysindexes table)</title>
		<description>Query to get a list Statistics in the database (from sys.sysindexes table)

select name, rowcnt, rowmodctr,* from sys.sysindexes where rowcnt = 0 and name like '%_WA%'


All Statistics objects in the sys.sysindexes have rowcnt = 0 and its name starts from '_WA' </description>
		<link>http://www.sqlstatistics.com/query-to-get-a-list-statistics-in-the-database-from-syssysindexes-table/</link>
			</item>
	<item>
		<title>Run SP_RECOMPILE after SP_UPDATESTATS</title>
		<description>SP_UPDATESTATS refers to work against all user-defined tables in the current database.

For the stored procedures performance you need to recompile them in order to take the new plan in to the memory, so run SP_RECOMPILE for all or required stored procedures to compare the sequence of performance. </description>
		<link>http://www.sqlstatistics.com/run-sp_recompile-after-sp_updatestats/</link>
			</item>
	<item>
		<title>How to do the UPDATE STATISTICS in SQL Server?</title>
		<description>If you want to find out if an index has had its indexes updated or not, you can use the command, like this:

DBCC SHOW_STATISTICS (table_name , index_name)


This command will not only tell you when statistics were last updated, but also provide you information on the kind of statistics that has ...</description>
		<link>http://www.sqlstatistics.com/how-to-do-the-update-statistics-in-sql-server/</link>
			</item>
	<item>
		<title>How does SQL Server know when to update statistics?</title>
		<description>SQL Server follows a very specific set of rules on when it should update the statistics of an index. Here they are:
- If the number of rows in a table are greater than 6, but less than or equal to 500, then statistics are automatically updated when there have been ...</description>
		<link>http://www.sqlstatistics.com/how-does-sql-server-know-when-to-update-statistics/</link>
			</item>
	<item>
		<title>What is UPDATE STATISTICS ?</title>
		<description>SQL Server keeps statistics about the distribution of the key values in each index and uses these statistics to determine which index(es) to use in query processing. Users can create statistics on nonindexed columns by using the CREATE STATISTICS statement.

Query optimization depends on the accuracy of the distribution steps:
-	If there ...</description>
		<link>http://www.sqlstatistics.com/what-is-update-statistics/</link>
			</item>
	<item>
		<title>Reason why Update Stats with SAMPLE may take longer then with FULLSCAN</title>
		<description>FULLSCAN is the same as SAMPLE RATE 100 with the difference that with SAMPLE RATE, SQL Server 2005 might adjust the rate up (and use a sample rate that is sufficiently high to create useful statistics) and if the requested rate creates more values than is considered needed, it "tries ...</description>
		<link>http://www.sqlstatistics.com/reason-why-update-stats-with-sample-may-take-longer-then-with-fullscan/</link>
			</item>
	<item>
		<title>SQL script to find NULL statistics if they exist</title>
		<description>SELECT 'update statistics' + ' ' + RTRIM(object_name(I.id)) + ' ' + RTRIM(name)

/* DATALENGTH (statblob) size,
STATS_DATE (I.id, I.indid) last_updated */
FROM
sysindexes as I

WHERE
OBJECTPROPERTY(I.id, N'IsUserTable') = 1 AND
INDEXPROPERTY (I.id , name , 'IsAutoStatistics' ) = 1 AND
DATALENGTH (statblob) is null </description>
		<link>http://www.sqlstatistics.com/sql-script-to-find-null-statistics-if-they-exist/</link>
			</item>
</channel>
</rss>

