Kumar AU

Kumar AU

  • 1.4k
  • 309
  • 62k

How to Extract the Query result to directly to .XLSX File

Jul 4 2016 3:36 AM

Dear All, 

Could you please let me know how to Extract Query result to Excel sheet in SQL server,

My query is batch Job, so I need to keep all my query result in Excel sheet, Later I will do FTP.

Please suggest me is there any way to do in SQL Server.

Note :- Not using Result to File in Management studio, I need to know using any scripts in Sql

Example this is my Query :- Select * form Users where Createddate >= dateadd(day,datediff(day,1,GETDATE()),0).
 
This result should directly go to Excel sheet 
Please help me 

Answers (5)