Delete Excel Spreadsheet from SSIS

Last Post 13 Aug 2008 10:29 PM by SQLUSA. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
stabos
New Member
New Member

--
13 Aug 2008 10:47 AM
Can anyone tell me how to delete the contents(except the cloumn headings) of an excel file that I have stored on a network drive from within SSIS?

Thank You.
SQLUSA
New Member
New Member

--
13 Aug 2008 10:29 PM
This is one way:

import the spreadsheet into a staging table in tempdb
truncate the table
export the empty table back to excel

Let us know if works.

Kalman Toth - Database, Data Warehouse & Business Intelligence Architect
SQL Server Training, SSAS, SSIS, SSRS: http://www.sqlusa.com/
SQLUSA
New Member
New Member

--
13 Aug 2008 10:29 PM
This is one way:

import the spreadsheet into a staging table in tempdb
truncate the table
export the empty table back to excel

Let us know if works.

Kalman Toth - Database, Data Warehouse & Business Intelligence Architect
SQL Server Training, SSAS, SSIS, SSRS: http://www.sqlusa.com/
SwePeso
New Member
New Member

--
13 Aug 2008 11:36 PM
Must you use SSIS?
You can easily do this with OPENROWSET.
stabos
New Member
New Member

--
14 Aug 2008 07:55 AM
I will try importing the spreadsheet then exporting back out.

Thank You very much.
SQLUSA
New Member
New Member

--
14 Aug 2008 11:35 PM
quote:

Originally posted by: Pesomannen
Must you use SSIS?
You can easily do this with OPENROWSET.



Can you provide a script sample?

Kalman Toth - Database, Data Warehouse & Business Intelligence Architect
SQL Server Training, SSAS, SSIS, SSRS: http://www.sqlusa.com/

stabos
New Member
New Member

--
19 Aug 2008 05:45 AM
Hey SQLUSA,

I tried doing what you said. I got to the point of exporting the truncated tmp tbl backout to excel and that's where things went wrong. My export package(I used the export wizard and saved it) is not working. When I looked out on the network drive the spreadsheet still has the old data in it instead of being blank. I get no errors, so that's were I'm confused.

Please help!!

Thank You.
stabos
New Member
New Member

--
20 Aug 2008 12:14 PM
How would I use OPENROWSET to connect to an Excel spreadsheet?

Thank You.
You are not authorized to post a reply.

Acceptable Use Policy