RemoveCharValues
-- =============================================
-- Author : Ramesh Subramanian
-- ALTER date : 25-July-06
-- Description : to remove the char values
-------------------------------------------------
-- ==============r===============================
CREATE FUNCTION [dbo].[RemoveCharValues] (
@vchString VARCHAR(MAX)
)
RETURNS VARCHAR(8000)
--WITH ENCRYPTION
BEGIN
-- find if character exists remove the character
WHILE (PATINDEX('%[A-Z]%',@vchString))>0
BEGIN
SET @vchString = REPLACE(@vchString,SUBSTRING(@vchString,PATINDEX('%[A-Z]%',@vchString),1),'')
END
-- return the numeric part
RETURN @vchString
END
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment