SSIS : Loading NULLs for string values from excel macro to SQL database table

kkran 831 Reputation points
2023-03-02T23:55:39.1633333+00:00

Hi All - I have an excel Macro sheet which is a source for me. I created an SSIS package and loads the data from excel to SQL Database table. The data is loading fine but for One column 'Column1#' it has values like below:
User's image

When loading the data for this column1#, the values for FCST is showing up as NULL in SQL table.

In SQL Table, this column is varchar(255) NULL and also i tried with nvarchar(255) NULL as well.
In SQL table its loading as below:
User's image

What steps should i take to flow the data as is without missing any data from this column.

Thank you in advance.

SQL Server Integration Services
SQL Server | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 41,536 Reputation points
    2023-03-03T02:17:35.01+00:00

    Hi @kkran

    I could not re-produce the issue, it seems to be related with the setting of your excel.

    Add Data Conversion or Derived Column to convert the column1 to [DT_WSTR] or [DT_STR], and then load the data to sql table to see if it is helpful.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


  2. ZoeHui-MSFT 41,536 Reputation points
    2023-03-06T07:14:09.8666667+00:00

    Hi @kkran,

    Use Derived Column to remove the quote and then preview the data for a try.

    REPLACE(column,"'","")

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  3. kkran 831 Reputation points
    2023-03-13T18:55:46.6066667+00:00

    Thank i tried the options but this didn't resolve.

    But however, i had to change the column format in EXCEL to Text, which resolved the issue.

    0 comments No comments

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.