none
msdb.dbo.sp_send_dbmail to email Excel attachment with multiple tabs RRS feed

  • Question

  • I am currently use msdb.dbo.sp_send_dbmail  to email data via Excel attachment based on a query - all inside a stored procedure.

    What I need to know is how to send data via Excel where Excel file has multiple tabs, each one for each different query.

    Thank you!

    Thursday, December 5, 2019 7:48 PM

All replies

  • You may be out of luck naively inside SQL Server. But you can give it a try with powershell module: ImportExcel.

    https://www.powershellgallery.com/packages/ImportExcel/5.4.2

    Thursday, December 5, 2019 8:17 PM
    Moderator
  • Hi apr301975,

    Thank you for your issue .

    Also , I will advice you to import EXCEL into SQL Server database . Please check following article .

    Import data from Excel to SQL Server or Azure SQL Database

    Best Regards,

    Rachel 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 6, 2019 2:23 AM
  • Hi ,

     

    I am writing to follow up this thread with you. Have you solved your issue? If you have solved your issue ,in order to close this thread, please kindly mark helpful replies as answers. By doing so, it will benefit all community members who are having this similar issue.  Your contribution is highly appreciated.

     

    Best Regards,

    Rachel


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 13, 2019 9:01 AM