Solved

Script to Output Table as multiple files

Posted on 2007-12-03
2
126 Views
Last Modified: 2013-11-30
Need Script or SSIS package that accept number of files as an argument and then export the table broken into that many files?  
0
Comment
Question by:donnatronious
  • 2
2 Comments
 
LVL 30

Expert Comment

by:nmcdermaid
ID: 20401568
The simplest way be to use some kind of paging SP (there are plenty out there). Based on the number of records, and the number of files, work out how many records each file will have. You then have a bunch of numbers that you can use in:

1. A For Each Loop
2. Inside the for each loop, a data flow which calls the paging SP and gets the records

The for each will also need to alter the output file used by the data flow.

Why do you want to chunk it up?
0
 
LVL 30

Accepted Solution

by:
nmcdermaid earned 500 total points
ID: 20401581
Here's a link to one particular paging solution:

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_22953186.html

Get that working in Management Studio First, then think about the For Each logic.


You can create package variables and assign them from the command line if you want something that will do this from the command line.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question