Loop through SQL table.

Hi Guys
I think what I am asking is simple.
But I can not work it out.

I have a Microsoft SQL table.
It is one column. Example below.

Microsoft XP.
Windows 2003
Micrososoft SQL 2003.

I need to pick each Product and insert into another table.

An example of the insert statement : Insert into Accepted_ Products(Client_Id,ContactNumber,Product)
                                                            Values ('022222222',2,'Microsoft XP')

I need to loop through Product table replacing Product with next item.

Any help highly appreciated

Shezad AhmedAsked:
Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
something like this:
insert into accepted_products (Client_Id,ContactNumber,Product)
select ('022222222',2, product from yourtable
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.