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)
 Array and loop

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-12-13 : 07:39:18
Gennady writes "If I do have an array with 12 parameters on it

@Array = ‘1,2,3,4,5,6,7,8,9,10,11,12’ or
@Araay = 'A, B, C, D, E, F, G, Z, H, K, L, M, W, J'

What I try to do that be able to find a number 6 in my array list, and also I want to loop from that position 6 times. What I am saying that I would be able to find a start point, which is 6, and recreate an array so it will be looking like:

@Array =’6,7,8,9,10,11’

Please help me if you have any ideas"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-13 : 08:09:43
Is this?

Declare @Array varchar(100)
set @Array = '1,2,3,4,5,6,7,8,9,10,11,12'
Select substring(@Array,charindex('6',@Array),len(@Array))

What do you want to do?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -