Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to Excel

Status
Not open for further replies.

claws2rip

Programmer
Dec 14, 2001
80
US
I'm trying export data from a sql server table to an Excel file using SSIS.

1. Is there a way to get the package to override the file every time it runs?

2. Apparently SSIS does not allow implicit conversion. For some reason I keep on getting an error that I cannot convert between unicode and non unicode string data types.

To resolve this I tried two things:
1. changed all the datatypes on the export columns from string [DT_STR] to Unicode string [DT_WSTR]. which in itself is a pain in the neck b/c you have to change each field manually.

2. I added a "data conversion" transformation as an intermediary btw SQL and Excel to convert all of the data types.

Both options failed..

Does anyone know how to resolve this issue?

thanks
sam
 
I use a template file, and a script task.

First, delete the existing file.

Second, copy your template to the file location, giving it the name of your desired output file.

You can do this in a script task. Have a look at the System.IO.File class.

I don't know why your data conversion failed, you would have to give more information on what is coming from SQL.

Hope this helps,

Alex



[small]----signature below----[/small]
I can't compete with you physically, and you're no match for my brains.
You're that smart?
Let me put it this way. Have you ever heard of Plato, Aristotle, Socrates?
Yes.
Morons!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top