轻设计 / 轻生活 / 轻日记 / 轻梦想
=== zhoumojianshe ===
函数源码:
CREATE FUNCTION [dbo].[StripAllTags] ( @input NVARCHAR(MAX)--2000内改为VARCHAR(8000) ) RETURNS NVARCHAR(MAX) AS BEGIN declare @Result nvarchar(MAX), @start int, @end int, @len int set @input = @input+'<>' set @Result = '' set @len=len(@input) set @start = charindex('<',@input,1) set @end = charindex('>',@input,@start) while(@start<@end) begin if(@start<>1) set @Result = @Result + substring(@input,1,@start-1) set @len = @len - @end set @input = substring(@input,@end+1,@len) set @start = charindex('<',@input,1) set @end = charindex('>',@input,@start) end RETURN replace(@Result,' ','') END本文由周末简设原创出品,如需转载请注明出处