自定义函数 不兼容的对象类型
alter function division(@strFieldValue varchar(1000),@spChar varchar(10))returns @tb table(id int,member varchar(40)) asbegindeclare @strTask_id int declare @intTimes intselect @strTask_id = (select task_id from Tid where members = @strFieldValue)select @intTimes = charindex(',',@strFieldValue) while(@intTimes>=0) begin if(@intTimes >0) begin select @strFieldValue = substring(@strFieldValue,charindex(',',@strFieldValue)+1, len(@strFieldValue)) insert @tb select @strTask_id,@strFieldValue select @intTimes = charindex(',',@strFieldValue) end else begin insert @tb select @strTask_id,@strFieldValue select @intTimes = -1 end endreturn end