Write File Transformation

Data Transformation Services

Data Transformation Services

Write File Transformation

The Write File transformation copies the contents of a source column (data column) to a file whose path is specified by a second source column (file name column).

When you configure the transformation, you define the path containing the files listed in the file name column. All the files must be in the same directory path. If the file is not found in the path, one is created and initialized with the contents of the data column.

Note  The directory name can start with a disk drive or a Universal Naming Convention (UNC).

If a file with the same name already exists, the transformation does one of the following:

  • Replaces the existing file.

  • Appends the contents of the data column to the existing file.

  • Fails step execution.

Before configuring a Write File transformation, consider the following:

  • A destination connection must be specified, although the content may or may not be copied to a destination.

  • If the contents of the data column are Null, the transformation deletes the file specified by the save path. However, if you select the Append if file exists check box, the file is not deleted.

The Write File transformation fails if:

  • The save path matches an existing file and you do not select the Overwrite if file exists check box.

  • The value in the File name column check box is not a string type.

  • The data column is not a string or binary type.

  • The process does not have permission to write to the specified directory or overwrite an existing file.

  • The contents of the File name column check box are NULL or zero-length.

  • Invalid file name characters appear in the File name column check box.

  • The save path specifies a location in a nonexistent folder.

To perform a Write File transformation