Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Script to Output Table as multiple files

Posted on 2007-12-03
2
Medium Priority
?
133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

721 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