Can DatabaseMail attach a formatted Excel file

  • my query

    USE [AP_ECC]

    GO

    /****** Object: StoredProcedure [dbo].[ap_ecc_Mail_for_statuslog] Script Date: 02/06/2013 11:03:01 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    ALTER procedure [dbo].[ap_ecc_Mail_for_statuslog] as

    EXEC msdb.dbo.sp_send_dbmail

    @recipients=N'internal@zeroone.com'

    ,@body='Hi Team,

    Please find attached the status log for today.

    Please check the status .

    Regards,

    Reporting team

    '

    ,@subject ='Status Log for Today'

    ,@profile_name ='Status HDS A'

    ,@query ='SELECT [TableName]

    ,[DateLastRun]

    ,[StartTimeStamp]

    ,[EndTimeStamp]

    ,[StatusLastRun]

    FROM [ICMRPTSVR].[ICMRPTDB].[dbo].[icmrptdb_statuslog]'

    ,@attach_query_result_as_file = 1

    ,@query_attachment_filename ='Status_Log.txt'

    my query is attaching txt file i want it as excel type

  • please don't cross post

    http://www.sqlservercentral.com/Forums/Topic1416223-392-1.aspx

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply