SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create Multiple Excel output files


Create Multiple Excel output files

Author
Message
ByronOne
ByronOne
Old Hand
Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)

Group: General Forum Members
Points: 337 Visits: 457
Hi everyone - hope someone can help...

I have a SQL table that contains information on visits to our centre. The table contains a number of columns but the ones I'm interested in are: CentreName, DateOfVist and VisitorNumbers. I would like to create an SSIS job that would pull in the visitor information for the current month from this SQL Table then split the data by CentreName (either North, East, South or Central) before finally exporting the split files to Excel to a named folder (ideally naming the files with the name of the Centre and the reporting month and year).

Any suggestions?

Thanks in advance.

BO
robert.gerald.taylor
robert.gerald.taylor
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1793 Visits: 1486
ByronOne (10/17/2012)
I have a SQL table that contains information on visits to our centre. The table contains a number of columns but the ones I'm interested in are: CentreName, DateOfVist and VisitorNumbers. I would like to create an SSIS job that would pull in the visitor information for the current month from this SQL Table then split the data by CentreName (either North, East, South or Central) before finally exporting the split files to Excel to a named folder (ideally naming the files with the name of the Centre and the reporting month and year).

In your Data Flow task you could:

  • Use an OLE Source to query your database for the visits you're after

  • Use a conditional split to break out for North, East, South and Central

  • Direct the four outputs from the conditional split to a seperate Excel destination component


You can use a variable to store the date and put that in the expression for your Excel destination so your file names are something like: South20121017.xls.

I hope that helps at a high level,
Rob
ByronOne
ByronOne
Old Hand
Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)Old Hand (337 reputation)

Group: General Forum Members
Points: 337 Visits: 457
Cheers Rob

That's the pointer I needed!

BO
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search