December 6, 2013 at 11:13 pm
Hi,
I need to create an empty excel sheet using T-SQL.
Can any one help me out in this?
Thanks in advance
December 8, 2013 at 2:38 pm
1) You can take a look at this link https://www.simple-talk.com/sql/t-sql-programming/sql-server-excel-workbench/
2) You can create it via SSIS package and execute the package from ssms.
Igor Micev,My blog: www.igormicev.com
December 9, 2013 at 4:04 am
I doubt there is an "elegant" way to do this via TSQL.
You might be better off trying the SQL CLR, I would imagine you could code against the Excel Object Model with it.
December 10, 2013 at 12:08 am
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
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply