Home Forums SQL Server 2008 T-SQL (SS2K8) need to create an excel sheet without any data in it RE: need to create an excel sheet without any data in it

  • Here is an outline of a simple method which does not require Excel to be installed:

    1. Copy a blank worksheet on to your SQL Server called YourTemplateWorksheet.XLSX

    2. EXEC xp_cmdshell 'COPY C:\YourTemplateWorksheet.XLSX C:\YourNewWorksheet.XLSX'

    This is over simplified but hopefully you get the idea. You need to run the usual gamut of security issues around xp_cmdshell