I’m trying to export data to .xlsx
via T-SQL. I changed the script to .xlsx
and the file is corrupted.
Is there a way directly export to .xlsx
or use a .csv
file and convert it to .xlsx
via SQL script?
SET @BcpStatement = 'bcp "' + @SqlStatement + '" queryout "' + @ExportFileName + '" -t"," -c -T'
Thank you.
3