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
 Transact-SQL (2005)
 Find alphanumeric characters

Author  Topic 

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2009-02-16 : 09:50:33
Hey is there a way to find all the rows in a column that are alphanumeric characters i know that the first 3 letters are always alphanumeric characters, i want to update another column based on this.

Sample of my data is

ABC123
DEF432
099999
ASD123
122345

i want to find the data set of this

ABC123
DEF432
ASD123

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-16 : 09:52:30
[code]select * FROM Table WHERE field LIKE '[A-Za-z]%'[/code]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-16 : 09:53:06
http://sqlblogcasts.com/blogs/madhivanan/archive/2009/02/16/find-alphanumerals-only.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-16 : 09:54:10
quote:
Originally posted by visakh16

select * FROM Table WHERE field LIKE '[A-Za-z]%'



It wont work in all cases

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-16 : 09:56:08
quote:
Originally posted by madhivanan

quote:
Originally posted by visakh16

select * FROM Table WHERE field LIKE '[A-Za-z]%'



It wont work in all cases

Madhivanan

Failing to plan is Planning to fail


sorry Madhi, didnt get you there. Isnt op asking for case where its starts with alphabet
Go to Top of Page

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2009-02-16 : 10:06:26
Thanks this did the trick.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-16 : 11:27:25
select * FROM Table WHERE field LIKE '[A-Za-z][A-Za-z][A-Za-z]%' -- just in case some record is A23423




E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-17 : 01:30:53
quote:
Originally posted by visakh16

quote:
Originally posted by madhivanan

quote:
Originally posted by visakh16

select * FROM Table WHERE field LIKE '[A-Za-z]%'



It wont work in all cases

Madhivanan

Failing to plan is Planning to fail


sorry Madhi, didnt get you there. Isnt op asking for case where its starts with alphabet


See peso's reply

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -