SSIS Data from SQL Server into an Excel File Using SSIS

Rontech10111 161 Reputation points
2025-01-30T10:30:43.9133333+00:00

Good day,

I have data like the below:

CREATE TABLE [dbo].[test_data](

[Local_Site] varchar NULL,

[LM_Company] [int] NULL,

[TotalStaff] [int] NOT NULL,

[NewOpp] nvarchar NULL,

[ExistOpp] nvarchar NULL,

[EasyTarget] [int] NOT NULL,

[GoldTarget] [int] NOT NULL,

[PremierTarget] [int] NOT NULL,

[BusinessTarget] [int] NOT NULL,

[COMMENTS] varchar NULL,

[SSCode] varchar NULL

) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

INSERT [dbo].[test_data] ([Local_Site], [LM_Company], [TotalStaff], [NewOpp], [ExistOpp], [EasyTarget], [GoldTarget], [PremierTarget], [BusinessTarget], [COMMENTS], [SSCode]) VALUES (N'Romey Park', 7860940, 3, N'3', N'0', 3, 0, 0, 0, NULL, NULL)

INSERT [dbo].[test_data] ([Local_Site], [LM_Company], [TotalStaff], [NewOpp], [ExistOpp], [EasyTarget], [GoldTarget], [PremierTarget], [BusinessTarget], [COMMENTS], [SSCode]) VALUES (N'Northvale', 7860940, 5, N'5', N'0', 5, 0, 0, 0, NULL, N'ss453890')

INSERT [dbo].[test_data] ([Local_Site], [LM_Company], [TotalStaff], [NewOpp], [ExistOpp], [EasyTarget], [GoldTarget], [PremierTarget], [BusinessTarget], [COMMENTS], [SSCode]) VALUES (N'Killarney', 7860940, 4, N'0', N'0', 0, 0, 0, 0, N'I called the client again to follow up and arrange a date for the presentation. The client''s response was that they would like to postpone.', N'ss334678')

INSERT [dbo].[test_data] ([Local_Site], [LM_Company], [TotalStaff], [NewOpp], [ExistOpp], [EasyTarget], [GoldTarget], [PremierTarget], [BusinessTarget], [COMMENTS], [SSCode]) VALUES (N'Douglasdale', 7860940, 4, N'0', N'0', 0, 0, 0, 0, NULL, N'ss457890')

GO

 

I would like to export this data to excel 2016 using an SSIS package.

 

How can I create the package so that the data types are correct in the excel columns, thus numeric column data should be 'number' format and non-numeric column data should be 'text' format

 

The result I get is the below (the numeric data is not of a number format):

 

 Screenshot 2025-01-30 124311

 

Kindly advise

 

Thanks

 

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,649 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 46,036 Reputation points
    2025-01-30T10:45:07.5033333+00:00

    SSIS Excel destination know values, but no format informations.

    See Import data from Excel or export data to Excel with SQL Server Integration Services (SSIS)

    => 4. Known issues and limitations. => data types

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. ZoeHui-MSFT 40,901 Reputation points
    2025-02-03T01:23:24.9366667+00:00

    Hi @Rontech10111,

    The Excel driver recognizes only a limited set of data types. For example, all numeric columns are interpreted as doubles (DT_R8), and all string columns (other than memo columns) are interpreted as 255-character Unicode strings (DT_WSTR).

    The easiest way is converting the datatype from Excel by format the cell.

    Regards,

    Zoe Hui


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

    0 comments No comments

Your answer

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