How to Write a Variable to a Text File in SSIS

104 37
    • 1). "Create" a new SSIS package in the desired manner.

    • 2). "Create" a "string variable" that will be used to specify the location of the text file and give it a default value.

    • 3). "Add" a "Data Flow" to the package and "edit" it to complete the desired task.

    • 4). "Add" an "OLE DB Source" component to the package and "edit" it to complete the desired task. For the "data access mode:" select, "Sql Command from Variable:." then, enter your SQL command in the space provided.

    • 5). "Add" a "Script Task" to the package and "edit" it to complete the desired task. In the script task editor, select the "ReadWriteVariables" as "FileLocation." This variable will be used to generate the full file name of the destination file. Open the Script editor to include code to generate the file name.

    • 6). "Add" a "Flat File Destination" and "edit" it to complete the desired task.

    • 7). "Create" a new "Flat File Destination Connection Manager" and "edit" it to complete the desired task.

    • 8). "Rename" the "Connection Manager" to the preferred name and "provide" the "designation file name."

    • 9). Select the "Mapping" tab to populate the mappings between the source and the destination file.

    • 10

      Complete your SSIS package.

    • 11

      Run the package and test it to make sure it completes the task in the desired manner.

Source...

Leave A Reply

Your email address will not be published.