Professional Documents
Culture Documents
Data Flow
Data Flow
For any data flow task, you can have one or more
Destinations, specifying where marbles (or data
records) will end up.
Our Example
Well write a package to export films to a text file, then export this into another table:
Copyright 2015
Page 19
3.2
Its likely in our example that well reuse the same connection (ie the same link to a SQL Server
or other database) many times, so it makes sense to define it at project level:
a)
b)
d)
e)
f)
Copyright 2015
Page 20
3.3
To accomplish our task, we need a single data flow task (this can be as complex as you like
many applications in SSIS will consist of one data flow task only).
b)
Another way to create a data flow task click on the Data Flow tab,
then click on this link which appears:
Wise
Wise Owls
Owls
Hint
Hint
Copyright 2015
Page 21
3.4
Creating Sources
You can create sources either using the assistant (basically a wizard) or the hard way:
This assistant will help you
add sources to a data flow
task (see hint below).
Wise
Wise Owls
Owls
Hint
Hint
Copyright 2015
The advantage of using the source assistants is that SSIS will then only
lists out sources for which you have drivers installed on your computer
(although this manual will show creating sources the long way).
Page 22
b)
Double-click on your new data source and set the following details:
What
Notes
If youve created one for your project (as weve done), you can just use this;
otherwise, click on the New button to create one specific to this package.
Table or view
The name of a table or view in your database (although its better practice to
use an SQL command, as overleaf, to pick out only those columns we want to
work with).
Copyright 2015
Page 23
c)
a)
Choose to
work with an
SQL command.
b)
Click here
to build your
query (or just
paste it in to the
SQL command
text window).
Click to specify
which columns the
data source should
output.
b)
Copyright 2015
Page 24
3.5
To create a connection manager for the destination for our data flow, we first need to create a
connection to a flat file. Heres how to do this!
a)
Wise
Wise Owls
Owls
Hint
Hint
Copyright 2015
If you had several packages using the same flat file, you might choose
instead to define a connection manager at project level.
Page 25
Copyright 2015
b) The description is
optional!
Page 26
Choose to
show Columns.
b)
Choose the
column separator
(ours is a vertical
bar character).
c)
Click on this
button (disabled
here) to bring the
preview shown up
to date.
Show advanced
settings for this
connection manager.
b)
Change the
column width to a
higher number, to
accommodate longer
film names.
Copyright 2015
Page 27
3.6
Again, you could use the Destination Assistant to add a destination, but well do things the
(slightly) harder way.
Copyright 2015
a)
b)
Page 28
b) SSIS automatically
takes you to this tab.
c) SSIS guesses that you want to assign the flat file connection manager to
this flat file destination task a not unreasonable guess!
Choose this
tab.
b)
Click on this
drop arrow and
choose to map the
FilmOscarWins
column from the
source on to the
Oscars column in
the destination.
Copyright 2015
Page 29
3.7
Copyright 2015
b)
Things are going well every part of the data flow has a
tick next to it!
c)
Page 30