469,128 Members | 1,655 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,128 developers. It's quick & easy.

Delete an excel worksheet only if it exists, in a dts package

Hi :

1. I import data into sqlserver, from an excel file, from a worksheet
within it, named 'input_data'
2. then i scrub the data in sqlserver
3. then i export some data into the same excelfile but into another
worksheet named 'output_data'

I have got it working and this is how i am doing it right now. I am
having a problem in the few steps identified below :

1. I delete the worksheet 'output_data' using an execsql task
DROP TABLE `output_data'

2. Then i have another execsql task to create it
CREATE TABLE `output_data`

3. Then i have datapump task to put data into worksheet.

The work fine, but i am running into a problem, when the output_data
worksheet doesnt exist.
So i need to write a query telling
IF `output_data` doesnt exist, then DROP IT

How do i do this
I am open to doing this in ActiveX Script(vbscript) and ExecSQL task

Also i do not have excel dll or runtime in my dbserver.

Please let me know

Jun 18 '07 #1
1 4267
apologize for typo
I do have a problem, when 'output_data' worksheet does exist
and hence need a query telling,

if output_data worksheet exists, then drop it

thank you

Jun 18 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Rudi Ahlers | last post: by
3 posts views Thread by hkappleorange | last post: by
6 posts views Thread by Elena | last post: by
3 posts views Thread by sun919 via DotNetMonster.com | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.