0

I'm new to SSIS and I want to generate an Excel file from a SQL table.

SQL table: mydata

Id    date       value
1     2013-02-2  236823
2     2013-02-3  185454

Now I need to generate an Excel file which will gives me an input like only date and value.

How can I generate that Excel file?

I have tried to do start a data flow task.

Inside I have taken OLE db Source and write SQL query select date, value from mydata, then added Excel destination.

But it is giving me an error in Excel destination:

external table is not in expected format

4
  • 1
    Check this article cavemansblog.wordpress.com/2009/04/17/… Commented Mar 20, 2013 at 16:29
  • Excel connection manager part is missing ? I'm getting an error in excel destination : external table is not in expected format Commented Mar 20, 2013 at 16:34
  • Is your Excel file open or r u using any password protected file ? Commented Mar 20, 2013 at 16:39
  • I want to create new excel file at location C:\test` and insert date,value` from sql table to excel file.. how can i do that? Commented Mar 20, 2013 at 16:48

1 Answer 1

1

My friend, what have you tried so far? This a simple click-click-click stuff. Next time, please share your effort. Here is the guidance:

1. Place a DFT on the Control Flow surface
2. Double-click on the DFT to enter into the Data Flow surface
3. Place an OLE DB Source. Double-click on it. Click on New... button and create a new OLE DB connection manager
4. Data access mode: Table or view. Select your table
5. Click on the columns. Select the fields you want.
6. Now place an Excel Destination. Connect it to the OLE DB Source.
7. Double-click and click on New... button. Give the Excel file path where you want to dump the data.
8. Click on New.. Some warning will appear. Accept it.
9. Select the Name of the Excel sheet from the drop down.
10. Run the package.

This is plain vanilla solution. Once you know the basics, polish your solution. For example, think about setting the connections through variables.

Good luck!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.