Big file with lots of columns doesn't output content of many of them

Naomi Nosonovsky 8,771 Reputation points
2025-10-07T16:58:13.9866667+00:00

Good day.

I have a SSIS package that selects the data using the following statement:

EXECUTE im_automation.accent_changes
WITH RESULT SETS
(
    (
        [Source] VARCHAR(30),
        Category VARCHAR(30),
        ProvType VARCHAR(30),
        [Social Group] VARCHAR(3),
        [Social Group Partner] VARCHAR(30),
        [Tracer ID] VARCHAR(30),
        [Request Type] VARCHAR(20),
        [Change Type] VARCHAR(100),
        [Status] VARCHAR(10),
        [OHCS Eff Date] DATE,
        [Earliest Eff Date] DATE,
        [OHCS Change Date] DATE,
        [OHCS Term Date] DATE,
        [Latest Term Date] DATE,
        [Social Grouping Term Date] DATE,
        ExclusionRreason VARCHAR(MAX),
        TinNumber VARCHAR(20),
        NPI VARCHAR(10),
        ProviderID VARCHAR(30),
        ProvLastName VARCHAR(40),
        ProvFirstName VARCHAR(40),
        ProvMI VARCHAR(10),
        ClinicName VARCHAR(40),
        Generation VARCHAR(100),
		[T50 Specialty] VARCHAR(100),
		
        [T50 ProvType] VARCHAR(100),
        [T15 Taxonomy] VARCHAR(100),
        LicenseNumber VARCHAR(40),
        LicenseSate VARCHAR(10),
        LicenseIssueDate DATE,
        LocAddress1 VARCHAR(100),
        LocAddress2 VARCHAR(100),
        LoCcity VARCHAR(100),
        LocState VARCHAR(10),
        LocZip VARCHAR(10),
        RemitAddress1 VARCHAR(100),
        RemitAddress2 VARCHAR(100),
        RemitCity VARCHAR(100),
        RemitState VARCHAR(10),
        RemitZip VARCHAR(10),
        ProvGroup VARCHAR(30),
        Specialty VARCHAR(100),
		Title VARCHAR(100),
        MainStatus VARCHAR(20),
        SubStatus VARCHAR(20),
        StatusDate DATE,
        [Client Eff Date] DATE,
        SubSpecialty VARCHAR(100),
        LocCounty VARCHAR(30),
        AcnProvID VARCHAR(40),
        OfficeLocationID VARCHAR(40),
        LocEffDate DATE,
        LocTermDate DATE,
        TinEffDate DATE,
        TinTermDate DATE,
        ProvPhone VARCHAR(20),
        ProvFax VARCHAR(20),
        Gender VARCHAR(30),
        ClienTermDate DATE,
        CredStatusEffDate DATE,
        [Social Grouping Effective Date] DATE,
        [Dually Contracted] VARCHAR(3)
    )
);

As you can see, there are lots of columns. It is supposed to generate a | delimited text file. However, many of the columns don't output values and instead output just the bars.

What can I do to fix the package? Is it a bug or limitation is SSIS?

P.S. It helps to print the code - I noticed typo in the ExlusionReason column. Update. Looks like this problem is related to script task attempting to add a footer to the file. It is either fails with the out of memory expression or produces bad data.

SQL Server Integration Services
{count} votes

Answer recommended by moderator
  1. Michael Le (WICLOUD CORPORATION) 3,495 Reputation points Microsoft External Staff
    2025-10-08T06:22:06.8733333+00:00

    Hello @Naomi Nosonovsky ,

    Out of Memory Exception

    A reliable method is to avoid reading the large data file into memory. Instead, you can create the footer in a separate, small file and then append it.

    • Adjust your package to first generate the main data file
    • Then use a separate, simple Data Flow Task to create a second file containing only the footer text.
    • Finally, add an Execute Process Task at the end of your control flow to run a copy command.

    If you still encounter issues after implementing the fix above, please check these within your main Data Flow Task:

    • Data Type Validation: Double-check that the data types and lengths defined in your Flat File Connection Manager exactly match the WITH RESULT SETS definition in your EXECUTE statement.
    • Column Mappings: Open your Flat File Destination, go to the Mappings tab, and ensure every column from the source is correctly mapped to its destination column.
    • Use a Data Viewer: Right-click on the data path arrow between your source and destination and select Enable Data Viewer. When you run the package in debug mode, a window will pop up showing you the data as it flows through that point.

    Please try the recommended solution for the footer first, as it is the most likely cause.

    I hope this helps.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.