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 |
epicphotoeye
Starting Member
4 Posts |
Posted - 2007-05-29 : 13:41:01
|
I'm having a hard time finding an efficent way of doing this. Currently I use UPDATE to remove some symbols but this takes a long time and sometimes I'm going through records by the thousands. Field 1-74.493 b(45503)-42.942 c(45560)want returnedField 174493455034294245560 |
|
netedk
Starting Member
11 Posts |
Posted - 2007-06-05 : 11:56:11
|
UPDATE TableASET field1 = dbo.FilterNonDigit(field1)WHERE ......CREATE FUNCTION [dbo].[FilterNonDigit]( @Input varchar(256))RETURNS varchar(256)ASBEGINIf PATINDEX('%[^0-9]%', @Input) > 0WHILE PATINDEX('%[^0-9]%', @Input) > 0SET @Input = Stuff(@Input, PATINDEX('%[^0-9]%', @Input), 1, '')RETURN @InputENDMarketing Communications: http://www.realmagnet.comSoftware Development:http://www.daksatech.com |
 |
|
|
|
|