Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 This question is for Graz

Author  Topic 

Rita Bhatnagar
Posting Yak Master

172 Posts

Posted - 2001-06-26 : 10:32:20
Hi
I used one of your old codes to write this function. Do you think it is fine.I am using it for 200 stored procedure.

CREATE FUNCTION Get_List( @array varchar(500) )
RETURNS @temp TABLE
(list_item int)

AS

BEGIN
declare @separator_position int
declare @array_value varchar(500)
select @separator_position= patindex('%,%',@array)
Set @Array =Stuff(@array,1,@separator_position,'')
While patindex('%,%',@array)<>0
Begin
select @separator_position= patindex('%,%',@array)
select @array_value = left(@array,@separator_position-1)
insert into @temp select @array_value
select @array=stuff(@array,1,@separator_position,'')
end
RETURN

END


   

- Advertisement -