August 18, 2011 at 7:34 am
Hi Everyone
I have an input column in an Excel Source, which is of type DT_NTEXT. Inside the data, there is a delimiter text which says "<Break Here>".
I have to split the column into two values. One before the delimiter and one after.
I am trying to write a script component, but am stuck with no idea.
Can some one please help as this helps a lot in automating an entire download - upload process.
Regards
Ashok T
August 18, 2011 at 10:49 am
ashok.theagarajan (8/18/2011)
Hi EveryoneI have an input column in an Excel Source, which is of type DT_NTEXT. Inside the data, there is a delimiter text which says "<Break Here>".
I have to split the column into two values. One before the delimiter and one after.
I am trying to write a script component, but am stuck with no idea.
Can some one please help as this helps a lot in automating an entire download - upload process.
Regards
Ashok T
I would use a Derived Column instead of a script and use Findstring, SubString, and Right to find the <Break Here> to make 2 new columns.
August 18, 2011 at 11:22 am
Hi.
Thanks for the reply. I tried but it keeps saying that DT_NTEXT cannot be used for those string manipulation functions.....
Any idea on how to get over it..
Thanks again
August 18, 2011 at 11:43 am
August 18, 2011 at 2:35 pm
ashok.theagarajan (8/18/2011)
Hi.Thanks for the reply. I tried but it keeps saying that DT_NTEXT cannot be used for those string manipulation functions.....
Any idea on how to get over it..
Thanks again
Cast it as another datatype DT_STR or DT_WSTR and then use the string functions
August 18, 2011 at 3:49 pm
ashok.theagarajan (8/18/2011)
Hi EveryoneI have an input column in an Excel Source, which is of type DT_NTEXT. Inside the data, there is a delimiter text which says "<Break Here>".
I have to split the column into two values. One before the delimiter and one after.
I am trying to write a script component, but am stuck with no idea.
Can some one please help as this helps a lot in automating an entire download - upload process.
Regards
Ashok T
Regarding the synchronous transformation script component, check out this link:
http://www.sqlis.com/sqlis/post/The-Script-Component-as-a-Transformation.aspx
It's an excellent walkthrough of the process.
Now, regarding the NText stream... yeaaaah, you've got a concern here. You can pull the NText into a string variable, perform the necessary tasks, and redump, but that can be HUGE. Just be prepared for that and set your output columns appropriately... IE: NText. Or make sure you put checks and restrictors on the output from the transformation before you include them in the output columns.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
August 18, 2011 at 7:59 pm
I would just pork chop the provider of the spreadsheet and get them to do things right. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
August 22, 2011 at 4:28 am
Jeff Moden (8/18/2011)
I would just pork chop the provider of the spreadsheet and get them to do things right. 😉
The problem here isn't the providers, it's Excel. Once you crack 255 characters in a column it shifts from nVARCHAR(255) to nTEXT. That's just Excel. Not really much you can do about it but avoid the software entirely.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
August 24, 2011 at 11:37 am
Sorry could not post before as was held up at work.
Got the issue resolved. Took the data into a temporary table and then did the conversion from text to string...
Luckily, the data is just a couple of 10000 rows only...
Thanks everyone
Cheers.....
August 24, 2011 at 7:09 pm
Evil Kraig F (8/22/2011)
Jeff Moden (8/18/2011)
I would just pork chop the provider of the spreadsheet and get them to do things right. 😉The problem here isn't the providers, it's Excel. Once you crack 255 characters in a column it shifts from nVARCHAR(255) to nTEXT. That's just Excel. Not really much you can do about it but avoid the software entirely.
Hmmm.. Is it Excel or is it SSIS?.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 25, 2011 at 12:55 pm
Jeff Moden (8/24/2011)
Evil Kraig F (8/22/2011)
Jeff Moden (8/18/2011)
I would just pork chop the provider of the spreadsheet and get them to do things right. 😉The problem here isn't the providers, it's Excel. Once you crack 255 characters in a column it shifts from nVARCHAR(255) to nTEXT. That's just Excel. Not really much you can do about it but avoid the software entirely.
Hmmm.. Is it Excel or is it SSIS?.
I suppose it would be best to say it's the drivers handling the connection, as I haven't used much else (besides VBA which doesn't row-sample, you have to define it) to connect to Excel in this method.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
August 25, 2011 at 2:01 pm
Evil Kraig F (8/25/2011)
Jeff Moden (8/24/2011)
Evil Kraig F (8/22/2011)
Jeff Moden (8/18/2011)
I would just pork chop the provider of the spreadsheet and get them to do things right. 😉The problem here isn't the providers, it's Excel. Once you crack 255 characters in a column it shifts from nVARCHAR(255) to nTEXT. That's just Excel. Not really much you can do about it but avoid the software entirely.
Hmmm.. Is it Excel or is it SSIS?.
I suppose it would be best to say it's the drivers handling the connection, as I haven't used much else (besides VBA which doesn't row-sample, you have to define it) to connect to Excel in this method.
I agree with you. It's one of the many reasons that we ask all of our vendors and clients to use csv or pipe delimited files instead. Excel imports have caused me much hair pulling and nail biting in the past.
MWise
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply