Now that you have the conversion, please tell us, what are you going to do with the result?
--Jeff Moden"Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! " "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row" For better, quicker answers, click on the following... http://www.sqlservercentral.com/articles/Best Practices/61537/
In case anyone is looking for the way to get numbers from a mixed string: select dbo.UDF_ParseNumbers('ABCD1234') will yield 1234. Here's a UDF that works:
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[UDF_ParseNumbers] ( @string VARCHAR(8000) ) RETURNS VARCHAR(8000) AS BEGIN DECLARE @IncorrectCharLoc SMALLINT SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string) WHILE @IncorrectCharLoc > 0 BEGIN SET @string = STUFF(@string, @IncorrectCharLoc, 1, '') SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string) END SET @string = @string RETURN @string END