Stream Task


SQL Server 2005, 2008, 2008R2, 2012, 2014

SQL Server 2005, 2008, 2008R2, 2012, 2014

Looking for older releases? Check here.

Overview

The Stream Task is an SSIS Control Flow task for management and manipulation of the standard Stream object.

Setup

Use the General page of the Stream Task Editor dialog to configure the parameters needed to work with a stream object.

Parameters

Name

Specify the task name.

Description

Specify the task description.

StreamVariable

Specify the variable containing the manipulated stream object. Select an existing user-defined variable, or click <New variable...> to create a new variable.

Related Topics: Integration Services Variables, Add Variable

Action

Specify the task action. This parameter has the options listed in the following table.

Option Description
Create a stream Creates a stream object. Selecting this action displays the dynamic parameters StreamType, IsFilenameVariable, Filename, FilenameVariable, OverwriteExisting.
Open file stream Opens a stream object to a file. Selecting this action displays the dynamic parameters IsFilenameVariable, Filename, FilenameVariable.
Read from stream Reads data from a stream. The result is an array of bytes. Selecting this option displays the dynamic parameters Read, Terminator, Length, ResultVariable, CloseAtEnd.
Write to stream Writes data to a stream. Selecting this option displays the dynamic parameters Write, IsTextVariable, Text, TextVariable, InputStreamVariable, CloseAtEnd.
Setup virtual file (1.6 SR-2) Setup virtual in-memory file. Selecting this option displays the dynamic parameters ResultVariable, Type, UseMemoryCache.
StreamType

Specify the type of stream object created. This parameter has the options listed in the following table.

Option Description
Normal Creates a file stream.
Memory Creates a memory stream.
Transfer Creates a transfer stream. This stream is useful for transferring data between processes. It allows for the simultaneous writing of data in one process and reading this same data in another process.

IsFilenameVariable

Indicate whether or not the file name is stored in a variable. This parameter has the options listed in the following table.

Option Description
True The file name is stored in a variable. Selecting this option displays the dynamic parameter FilenameVariable.
False The file name is specified in a File connection manager. Selecting this option displays the dynamic parameter Filename.
Filename

Select an existing File connection manager, or click <New connection...> to create a new connection manager.

Related topics: File Connection Manager Editor

FilenameVariable

Select an existing user-defined variable, or click <New variable...> to create a new variable.

Related Topics: Integration Services Variables, Add Variable

OverwriteExisting

Use this parameter to indicate that the existing file should be overwritten.

Read

Specify the type of read from a stream object. This parameter has the options listed in the following table.

Option Description
Terminator Reads from the stream until a specified terminator combination is reached.
Length Reads a fixed length from the stream.

Terminator

Specify terminator, which controls when reading should stop.

Length

Specify a fixed length to read from the stream.

ResultVariable

Select an existing user-defined variable, or click <New variable...> to create a new variable.

Related Topics: Integration Services Variables, Add Variable

CloseAtEnd

Use this parameter to indicate that the stream should be closed at the end of the action.

Write

Specify what is to be written to the stream object. This parameter has the options listed in the following table.

Option Description
Text Writes text to a stream.
Input stream Writes another stream to the target stream.

IsTextVariable

Indicate whether or not the text is stored in a variable. This parameter has the options listed in the following table.

Option Description
True The text is stored in a variable. Selecting this option displays the dynamic parameter TextVariable.
False The text is specified. Selecting this option displays the dynamic parameter Text.
Text

Specify the text to be written to the stream object.

TextVariable

Select an existing user-defined variable, or click <New variable...> to create a new variable.

Related Topics: Integration Services Variables, Add Variable

InputStreamVariable

Select an existing user-defined variable, or click <New variable...> to create a new variable.

Related Topics: Integration Services Variables, Add Variable

Type (1.6 SR-2)

Specify virtual file type. This parameter has the options listed in the following table.

Option Description
Read The virtual file will be used for reading (default).
Write The virtual file will be used for writing.
UseMemoryCache (1.6 SR-2)

Indicate whether memory cache is used for virtual file. This parameter has the options listed in the following table.

Option Description
True Memory cache is used.
False Memory cache is not used (default).

Samples

  • For a sample demonstrating the virtual file action, look at this package.