日期:2014-05-18 浏览次数:20558 次
if exists(select * from sysobjects where type='FN' and name='getSplitNum') drop function getSplitNum go create function getSplitNum(@content text,@split varchar(10)) returns int as begin declare @index int;set @index=1; declare @num int;set @num=0; declare @start int;set @start=0; while @index>0 begin set @index=charindex(@split,@content,@start); set @start=@index+1; set @num=@num+1; end return @num; end go