Help - Need to Generate insert statement for each comma seperated value within a column by record

  • I just rec'd a product catolog which list the products in this format:

    SKU    Name    Description                        SM     Med     LG     XL

    1        Shirt     Blue, Blue Green, Red          1.00   2.00     3.00   4.00

     

    First - I need to insert the SKU and each color individualy into our product / color table

    Product_Colors

    SKU     Color

    1        Blue

    1        Blue Green

    1        Red

    Second - I need to insert the SKU, Size, and Amount into our Product_Price Table.  I've been able to do this part in the past by creating insert statements for every size column.  I was wondering if it's possible to make this dynamic?

    Product_Price

    SKU     Size    Amount

    1        SM     1.00

    1        Med    2.00

    3        LG      3.00

    4        XL      4.00

     

    I apologize in advance if I dont see the obvious solution.  I am relatively new to TSQL development.

     

  • go though this document.

     http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm 

    Regards

    shrikant  

    Regards
    Shrikant Kulkarni

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply