• Love this script and the excel template. Thanks.:-)

    I have modified the line below by adding @@servername. This gives me a clearer picture on which SQL instance the report was run.

    from

    SELECT col1 as DT,' + @cols + N'

    to

    SELECT col1 as '+@@SERVERNAME+'_DT,' + @cols + N'