SQL Server - SSIS Package to Export SQL Server to Multiple Flat Files (based on size of row count)
Asked By JPo
18-Nov-09 06:49 PM
I have the need to create an export job that will query a large amount
of data from a SQL Server database and produce a flat file. Because
of the amount of data, I would like to create a maximum file size or
record count for each flat file - for example a query with 5M records
would produce 5 flat files, each with 1M records.
Can this be done within an SSIS package? I only have experience with
the simple import/export wizard.
Thank you in advance for any help!
SQL Server
(1)
Money
(1)
Database
(1)
Welch
(1)
Buckets
(1)
Jwelch
(1)
Todd C replied to JPo
I used to tell my COnsulting Clients:
If you are new to SSIS, I would not recommend attempting this in its
entirety. Start with small steps, maybe generting a single flat file from the
data.
Once you have that, experiment with how you would break up the source data
into equal buckets using WHERE clauses. Same those 'boundry' values in a SQL
table. Then set up a For Each that loops over the values and populates
variables. Inside the loop, have a parameterized SQL statement as the Source
in your data flow.
You might find some useful stuff at SQLIS.com or my blog:
http://toddchitt.wordpress.com/
Good Luck
=====
Todd C
Phil Brammer replied to JPo
Yes, this can be done, and John Welch has two great blog posts on this
topic:
Part 1 (requires scripting) -
http://agilebi.com/cs/blogs/jwelch/archive/2007/06/03/multi-file-output-destination-script-component.aspx
Part 2 (does not require scripting) -
http://agilebi.com/cs/blogs/jwelch/archive/2007/06/03/multi-file-outputs-part-2.aspx
Phil
ssistalk.com
xpsmtp for sql server 2005 SQL Server how can i use a xpsmtp in sql server 2005? SQL Server Discussions SQL Server (1) Money (1) Procedure (1) Database (1) From what I have read
Where can I find free SQL Server hosting? SQL Server Hi! Do you know any free MS SQL Server database hosting service? SQL Server Discussions SQL Express (1) SQL Server (1) Where can I find free SQL Server (1
about writes / sec SQL server SQL Server Hi Guys, Do you know how many writes / sec SQL server is capable of performing generally? Trying to work out what % of a DB we would be consuming. Thanks SQL Server Discussions SQL Server (1) Transaction (1) Schema (1) Money (1) Bytes (1) Probably many more
sql server agent insql2005 SQL Server i have sql server 2005 express and i cant find the sql server agent that was like in sql server 2000 why is that? where are the jobs
Programming Language with SQL Server ? SQL Server Hi, There is a consultant who designs web site for us. He says that he will use VB .NET for development and SQL Server 2005 Standard Edition is required. Since we are a small site with limited budget and we think that we can use SQL Server 2005 Express instead. This is because there is no connection limit to SQL Server 2005