Check-out the following SQL function.. this may help you!
--------------------------------------------------------------
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE function fn_ExtractNumericValues(@pstrCharValue nvarchar(30))
returns bigint
as ...