Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

First occurence of number in string Expand / Collapse
Author
Message
Posted Tuesday, January 27, 2009 12:37 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, December 20, 2010 4:47 AM
Points: 42, Visits: 141
Hi,

I have a string say, @vch= 'DMJ944542' .

How to extract just 944542 from this...

Thanks in advance.


"I Love Walking In The Rain So No One Can See Me Crying ! " ~ Charlie Chaplin
Post #643955
Posted Tuesday, January 27, 2009 12:47 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 8, 2014 6:13 AM
Points: 1,694, Visits: 19,550

select substring(@vch,patindex('%[0-9]%',@vch),100)



____________________________________________________

How to get the best help on a forum

http://www.sqlservercentral.com/articles/Best+Practices/61537

Never approach a goat from the front, a horse from the rear, or a fool from any direction.
Post #643959
Posted Tuesday, January 27, 2009 1:03 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, December 20, 2010 4:47 AM
Points: 42, Visits: 141
Thanks

"I Love Walking In The Rain So No One Can See Me Crying ! " ~ Charlie Chaplin
Post #643963
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse