IF OBJECT_ID(’DBO
DROP FUNCTION DBO
GO
CREATE FUNCTION DBO
RETURNS VARCHAR(
AS
BEGIN
WHILE PATINDEX(’%[^
BEGIN
set @s=stuff(@s
END
RETURN @S
END
GO
PRINT DBO
GO
IF OBJECT_ID(’DBO
DROP FUNCTION DBO
GO
CREATE FUNCTION DBO
RETURNS VARCHAR(
AS
BEGIN
WHILE PATINDEX(’%[^a
BEGIN
set @s=stuff(@s
END
RETURN @S
END
GO
PRINT DBO
GO
IF OBJECT_ID(’DBO
DROP FUNCTION DBO
GO
CREATE FUNCTION DBO
RETURNS VARCHAR(
AS
BEGIN
WHILE PATINDEX(’%[^吖
SET @S = STUFF(@S
RETURN @S
END
GO
PRINT DBO
GO
SELECT * FROM (select ’ASDKG論壇K聯通DL’ as col)TB WHERE COL LIKE N’%[吖
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22305.html