27,579
社区成员
发帖
与我相关
我的任务
分享
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER FUNCTION bbs(@aa varchar(1000))
RETURNS varchar(1000)
AS
BEGIN
declare @aaa varchar(100)
declare @i int
set @aaa=''
set @i = 1
while @i<=len(@aa)
begin
--100代表ascii码。。你找一下 字母最大的ascii是多少就可以了
if ascii(substring(@aa,@i,1))>100
set @aaa=@aaa+substring(@aa,@i,1)
set @i=@i+1
end
RETURN @aaa
END
--
/*
select ascii('你')
select substring('你好',1,1)
select dbo.bbs('dd你好')
*/
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO