Solved

Script to Output Table as multiple files

Posted on 2007-12-03
2
125 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now