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 |
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2004-03-31 : 12:14:20
|
| I have to Extract a numaric value from the center of a string in a SP.The Extract is always precided by a single Alpha and followed by 2 Alpha . ExampleString Extract resultR3343KL 3343R331JL127 331C12BS19 12I23976AL 23976Any Ideas.JimUsers <> Logic |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-03-31 : 12:27:22
|
| Hi Jim --Try something like this:declare @v varchar(100);set @v = 'A12444B'select substring(@v, 2, patindex('%[A-Z]',substring(@v,2,100))-1)there's a few other ways, but that's one ....- Jeff |
 |
|
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2004-03-31 : 12:49:45
|
| Thanks Jeff I forgot all About pattern Index.JimUsers <> Logic |
 |
|
|
|
|
|