• Dineshbabu (1/18/2013)


    If we run the profiler before clicking Display Estimated Execution Plan, we can see SHOWPLAN_XML option is set to ON.

    I think due to enabling this set option we are getting as "1 row(s) affected".

    Well... you were very close 🙂

    The "affected row" is the Estimated Execution Plan itself!

    Try running

    SET SHOWPLAN_XML ON

    GO

    <Whatever batch you want>

    GO

    SET SHOWPLAN_XML OFF

    GO

    and you'll get a result set with one column named "Microsoft SQL Server 2005 XML Showplan" and one row containing an execution plan. That row is displayed as "affected", and it doesn't matter what batch you estimate (it only must be a valid batch, otherwise you'll get a syntax error instead of any number of "affected rows").