I am exporting an excel file through SSIS using excel connection manager. I am using SSIS 2008 version and the excel is .xlsx
CREATE TABLE `Sheet1` (
`Date` DATETIME,
`NMMO` NVARCHAR(30),
`P1 #` NVARCHAR(30),
`P2 #` NVARCHAR(30)
)
but when i see the excel sheet, it gets created but the # symbol is replaced by . I have used P1 '#
but it does not make any difference. Is there any way i can retain the column names in excel as it is? Please Help
Best Answer
You can alter the table header using a script task:
Note: you have to add
Microsoft.Office.Interop.Excel.dll
file to the following directories (.Net Framework dll directory)C:\Windows\Microsoft.NET\Framework\v2.0.50727
and (sql server data tools dll directory)C:\Program Files\Microsoft SQL Server\100\DTS\Binn
(using vs 2005 and sql 2008) and then add this dll as a reference in your script taskDon't forget to set the Delay Validation property to
True
for DataFlow Task which contains the Excel Source.References