goofyui
goofyui

Reputation: 3492

Rename Excel Sheet Name in SSIS Package

SQL 2008 / VS 2008

I am exporting Excel Sheet to SQL Database. This package will be called from C# Application.

As the Sheet Name varies from Excel Sheet to Excel Sheet, Package fails. I have written a query inside the package as follows ..

select colum1,column2 from 'Sheet1$'

This Query exports data to SQL Database.

If i am able to rename the First Sheet Tab of the Excel Sheet as Sheet1, I will not be having any problem on Exporting to SQL DB.

Upvotes: 0

Views: 9868

Answers (1)

Pondlife
Pondlife

Reputation: 16260

The simplest solution is probably to use a Script Task to rename the sheet. Alternatively, you could write a Script Component to output the data directly from C# without altering the workbook or using SQL.

Upvotes: 1

Related Questions