/******返回传入的字符串的所有字符 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER function [dbo].[F_Get_Letter]
(
@Letter NVARCHAR(100)
)
RETURNS NVARCHAR(100)
AS
BEGIN
WHILE PATINDEX('%[^A-Z]%',@Letter)>0
BEGIN
SET @Letter=STUFF(@Letter,PATINDEX('%[^A-Z]%',@Letter),1,'')
END
RETURN @Letter
END
-----------
USE [YYMERP_MGYJ_LXY]
GO
/******返回传入的字符串的所有数字******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER function [dbo].[F_Get_No]
(
@No varchar(100)
)
RETURNS INT
AS
BEGIN
WHILE PATINDEX('%[^0-9]%',@No)>0
BEGIN
SET @No=STUFF(@No,PATINDEX('%[^0-9]%',@No),1,'')
END
RETURN @No
END