May 8, 2014 at 1:06 am
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
May 8, 2014 at 3:00 am
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
May 8, 2014 at 3:21 am
Thanks for that
May 8, 2014 at 4:12 am
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