Home Forums SQL Server 2008 SQL Server 2008 Administration Slow performance remains after query rebuild only gets resolved after updting statistics ? RE: Slow performance remains after query rebuild only gets resolved after updting statistics ?

  • USE AdventureWorks2012;

    DECLARE @schema_name SYSNAME,

    @table_name SYSNAME;

    SELECT @schema_name = N'HumanResources',

    @table_name = N'Department';

    SELECT st.name AS StatsName,

    STATS_DATE(st.object_id, st.stats_id) AS [LastUpdated]

    FROM sys.objects AS tbl

    INNER JOIN sys.stats st ON st.object_id = tbl.object_id

    WHERE tbl.name = @table_name

    AND SCHEMA_NAME(tbl.schema_id) = @schema_name;

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato