ALTER
(
@List
Returns
AS
BEGIN
BEGIN
SET @Item = LTRIM(RTRIM(LEFT(@List,@Pos-1)))
SET @List=SUBSTRING(@List,@Pos+DATALENGTH(','),8000)
RETURNENDIF @Item<>'' INSERT INTO @Items SELECT @ItemIF @Pos=0 SET @Pos=DATALENGTH(@List)+1SET @Pos=CHARINDEX(',',@List)WHILE DATALENGTH(@List)>0Declare @Pos As IntDeclare @Item As Varchar(Max) @Items Table (Item Varchar(Max) NOT NULL)
)
As Varchar(Max) FUNCTION [dbo].[FPSplit]
No comments:
Post a Comment