Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Conditional Split problem

Author  Topic 

Carat
Yak Posting Veteran

92 Posts

Posted - 2009-08-26 : 08:50:43
In a Conditional Split, I want to select the data rows where my column begins with an alphanumeric letter (A-Z). So the first letter of the column must be A - Z.

How can I achieve this?

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-08-26 : 09:05:30
You mean this?

Select * from table_name where column_name like '[A-Z]%'

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-08-26 : 09:05:42
You mean this?

Select * from table_name where column_name like '[A-Z]%'

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

Carat
Yak Posting Veteran

92 Posts

Posted - 2009-08-26 : 09:19:24
Not exactly, I mean this:

select * from table_name where left(column_name, 1) like '[A-Z]%'

But then in SSIS in a Conditional Split.
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-08-26 : 09:24:10
quote:
Originally posted by Carat

Not exactly, I mean this:

select * from table_name where left(column_name, 1) like '[A-Z]%'

But then in SSIS in a Conditional Split.



Both are same,
But this have different meaning!
select * from table_name where left(column_name, 1) like '[A-Z]'

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

Carat
Yak Posting Veteran

92 Posts

Posted - 2009-08-26 : 09:33:56
I know but I have to check the first letter only thats why I added the Left function. But how can I make either of the 2 queries in an SSIS Conditional Split work?
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-08-26 : 09:52:20
I don't think there is a LEFT string function. Try the SUBSTRING, like:
SUBSTRING(UPPER([Column0]),1,1) >= "A" && SUBSTRING(UPPER([Column0]),1,1) <= "Z"

May not be right - I can't test right now.
Go to Top of Page
   

- Advertisement -