• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2996
  • Last Modified:

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.

Product
-------------
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




0
Shezad Ahmed
Asked:
Shezad Ahmed
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
something like this:
insert into accepted_products (Client_Id,ContactNumber,Product)
select ('022222222',2, product from yourtable
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now