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 |
|
karthik0805
Starting Member
14 Posts |
Posted - 2012-09-28 : 06:39:29
|
| Is there any function to separate numeric values and characters in SQL?for example :String:'56879port782'Can we separate the numeric values from above string?expecting output is : '56879782' |
|
|
arpana patil
Starting Member
24 Posts |
Posted - 2012-09-28 : 06:55:56
|
| CREATE Function [dbo].[RemoveNonNumericCharacters](@Temp VarChar(1000)) Returns VarChar(1000) AS Begin While PatIndex('%[^0-9]%', @Temp) > 0 Set @Temp = Stuff(@Temp, PatIndex('%[^0-9]%', @Temp), 1, '') Return @TEmp End |
 |
|
|
karthik0805
Starting Member
14 Posts |
Posted - 2012-09-28 : 07:22:10
|
| Thank you, Arpana! |
 |
|
|
arpana patil
Starting Member
24 Posts |
Posted - 2012-09-28 : 07:29:50
|
welcome |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|