May 23, 2006 at 10:57 am
I'm new to SSIS and I'm just kind of winging it here using BOL. I'm trying to export data from SQL Server to an Excel worksheet.
I have a notes column in the SQL Server table that is a varchar(max) field. If the field is longer than the 32,757 limit of an Excel cell, I want to insert "Notes field too long" into Excel instead of the data from the Notes field. So far, the only way I've gotten this to work is using the Conditional split task which then inserts into two separate worksheets with no data in the Notes column for the long values. I've also tried doing an expression in the Derived Column Task, but am getting an error.
What task should I be using to accomplish either inserting the Notes field or inserting "Notes field too long" if longer than 32,757.
Thanks!
Wendy Schuman
Wendy Schuman
May 23, 2006 at 2:00 pm
I figured it out. The error I was getting for the expression in the Derived task was because I wasn't creating a package variable. I was trying to do this:
LEN(Notes) > 32757 ? "Notes Too Long" : Notes
I should have created a package variable by going to the SSIS menu and selecting Variables and create a variable named: NotesTooLong as string, then cast the string to text. The expression in the Derived Column task looks like this:
LEN(Notes) > 32757 ? (DT_NText)@[User::NotesTooLong] : Notes
Wendy Schuman
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply