|
InNomina
Starting Member
USA
38 Posts |
Posted - 01/24/2013 : 16:25:23
|
Ok, so the solution was to create a function. -------
CREATE FUNCTION [dbo].[fnRemoveNonNumeric] ( @BadString nvarchar(20) ) RETURNS nvarchar(20) AS BEGIN
DECLARE @nPos INTEGER SELECT @nPos = PATINDEX('%[^0-9_]%', @BadString)
WHILE @nPos > 0 BEGIN SELECT @BadString = STUFF(@BadString, @nPos, 1, '') SELECT @nPos = PATINDEX('%[^0-9_]%', @BadString) END
RETURN @BadString END
To test my function I used... update test set import = [dbo].[fnRemoveNonNumeric](IMPORT)
Worked like a charm!
Hope this saves a user out there hours of frustration!
------------------------- "If you never fail, you're not trying hard enough" |
 |
|