TSQL export to Excel (.xlsx)

SSinhg 286 Reputation points
2021-11-22T15:58:27.06+00:00

Hi,

Using tSQl is it possible to export to .xlsx format (Excel)... I'm looking to export from a table or view.

I have googled and read a few blogs on similar lines but they seam to work for .xls format only...

Any help or pointers will be highly appreciated.

Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 47,806 Reputation points
    2021-11-22T16:40:19.253+00:00

    Not directly in T-SQL. Normally export is handled using SSIS or similar tool.

    XSLX follows the Office OpenXML specification and ultimately is a ZIP file. T-SQL can generate text files but it isn't going to be able to generate an OpenXML document.


0 additional answers

Sort by: Most helpful