how to show only changed rows
Here is a version for SQL Server 2012 using the new LAG feature:

WITH CTE AS
(
    SELECT
        EventDateTime,
        Host,
        Flag,
        LAG(Flag)
            OVER (ORDER BY EventDateTime) AS PrevFlag
    FROM MyTable
)
SELECT EventDateTime, Host, Flag
FROM CTE
WHERE Flag &lt;&gt; PrevFlag;


Here is a version for SQL Server 2008 using a self join:

WITH CTE AS 
(
    SELECT
        EventDateTime,
        Host,
        Flag,
        ROW_NUMBER()
            OVER (ORDER BY EventDateTime) AS RowNum
    FROM MyTable
)
SELECT
    C.EventDateTime,
    C.Host,
    C.Flag
FROM CTE AS C
    INNER JOIN CTE AS D
    ON C.RowNum = D.RowNum +1
WHERE C.Flag &lt;&gt; D.Flag;