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.
| Author |
Topic |
|
elwoos
Master Smack Fu Yak Hacker
2052 Posts |
Posted - 2004-12-15 : 08:30:43
|
| I have a field that is varchar, the text in the field will begin with 0 or more numbers (possibly a comma and a space) and then some text. Anyone have any idea how I can remove the numbers I can match single numeric digits but how do I match a complete integer?e.g. I might have This is some text23, This is some more text12345678, This is even more textand I just wantThis is some textThis is some more textThis is even more textMany thankssteveTo alcohol ! The cause of - and solution to - all of life's problems |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2004-12-15 : 08:35:55
|
| SELECT SubString(col1, PatIndex('%[^A-Za-z]%', col1), 8000) FROM myTableThis will remove any leading non-alpha characters from the string. |
 |
|
|
elwoos
Master Smack Fu Yak Hacker
2052 Posts |
Posted - 2004-12-15 : 09:28:33
|
| Of course!! Why didn't I realise that!!!!!. Many thanks cheers steveTo alcohol ! The cause of - and solution to - all of life's problems |
 |
|
|
|
|
|