Create Table Excel Destination in SSIS

  • Hi Everyone. I have the following SQL Data types:

    1. NVARCHAR(255)

    2. INT

    3. NUMERIC (38,2)

    Can someone please tell me what the above SQL data types would be in a SSIS Excel Destination Create Table Statement. WHat Data types are available in a CREATE TABLE Statement for an Excel Destination.

    Thanks you

  • So are you creating your Excel destination dynamically? If so, then this snippet from an Execute SQL Task I've used to do the same thing may help:

    CASE WHEN c.DATA_TYPE IN('nvarchar','ntext','text','varchar','varchar','char','nchar','xml','uniqueidentifier')

    THEN 'LongText'

    WHEN c.DATA_TYPE IN('tinyint','int','smallint','bigint','float','numeric','decimal','money','smallmoney','bit')

    THEN 'Long'

    WHEN c.DATA_TYPE IN('date','smalldatetime','datetime','timestamp')

    THEN 'datetime'

    ELSE ' ' END + ',' + CHAR(10)

    FROM INFORMATION_SCHEMA.COLUMNS c

    Regards

    Lempster

  • Thanks for that

  • You're welcome. 🙂

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply