Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get element in list?

Status
Not open for further replies.

ducksoup

Programmer
Aug 17, 2001
35
US
I am iterating a cursor, adding the index to a comma-delimited string, to make sure that the index doesn't get inserted in the new table twice (for a complicated reason, it can happen -- I didn't write the original db, I'm trying to fix it).

What's the function to check the string for the existence of the index? Is there an easier datatype than a comma-delimented list to search under? Realize that, unfortunately, due to processing constraints, I have to iterate.

e.g.,

if [@index not in @already_processed]
begin
insert @index
@already_processed = @already_processed + ',' + @index
end
fetch next into @index

What goes in the brackets???? __________________________________
You don't see with your eyes, you perceive with your mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top