|
|
|
This stored procedure takes two parameters @ARRAY and @SEPARATOR. It loops through the array variable and pulls out the values inside it. Right now the stored procedure just prints the values it finds. It's written so as to be easily customizable to do exactly what you need it to. Enjoy and happy parsing! |
Click here to copy the following block |
Create procedure sp_ParseArray ( @Array varchar(1000), @separator char(1) ) AS
set nocount on
declare @separator_position int declare @array_value varchar(1000)
set @array = @array + @separator
while patindex('%' + @separator + '%' , @array) <> 0 begin
select @separator_position = patindex('%' + @separator + '%' , @array) select @array_value = left(@array, @separator_position - 1)
select Array_Value = @array_value
select @array = stuff(@array, 1, @separator_position, '') end
set nocount off go |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|