July 23, 2012 at 5:34 pm
Hi Guys,
I got stuck with this requirement where in I have 4 columns in my source file.
Lightwave 1250 West 2012-07-18
Princeton9 250 East 2012-06-15
Lewisville 645 Mid-west 2012-07-12
Thats my source and I want to load the data to a flat file destination. However I want to get rid of rows whose column 1 values have a number in it. For example I want to error out the second row in the above data. I really appreciate any help. I was stuck here. thanks for your time.
July 24, 2012 at 1:51 am
This might be a little too complex for a conditional split.
However, you can create a script component as a conditional split and use regular expressions to find out if the column contains a number.
Using the Script Component as a Conditional Split
check if string contains any numbers
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
July 24, 2012 at 10:28 am
Koen Verbeeck (7/24/2012)
This might be a little too complex for a conditional split.However, you can create a script component as a conditional split and use regular expressions to find out if the column contains a number.
Hi Koen,
Can you please give me a sample code to work with. I am not a programmer so it will be hard for me to figure out. I know it is too much to ask, hope you understand.
July 24, 2012 at 1:20 pm
you could use patindex to filter out if a column has a numerical value in it then dont return like so
where PATINDEX('%[0-9]%',col1)=0
***The first step is always the hardest *******
July 24, 2012 at 4:59 pm
And, please... no more double posts. It just splits up resources and answers. There are a lot of us that will look at all posts for a given day. Pick the correct forum and stick with it.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply