I have two tables "Product_Barcode_V1" and "Product_Barcode_V2". I have to write SQL which will tranfer "Product_Barcode_V1" data to "Product_Barcode_V2" table.
Tables structure and data values (Product_Barcode_V1)
ID INS_Code_NJ LIC_Code_NJ INS_Code_TX LIC_Code_TX
1 600-30000 600-28426 NULL 100-4260
2 600-35476 600-36621 100-23903 100-75414
3 600-37176 600-46891 100-23914 100-90963
I want to convert the above table in the following form:
(Product_Barcode_V2)
ID Source Type Barcode
1 NJ INS 600-30000
1 NJ LIC 600-28426
1 TX INS NULL
1 TX LIC 100-4260
2 NJ INS 600-35476
2 NJ LIC 600-36621
2 TX INS 100-23903
2 TX LIC 100-75414
3 NJ INS 600-37176
3 NJ LIC 600-46891
3 TX INS 100-23914
3 TX LIC 100-90963
Can anyone please help me write this Insert SQL for this.. Any help gretly appriciated.
Thanks,
Mike
Tables structure and data values (Product_Barcode_V1)
ID INS_Code_NJ LIC_Code_NJ INS_Code_TX LIC_Code_TX
1 600-30000 600-28426 NULL 100-4260
2 600-35476 600-36621 100-23903 100-75414
3 600-37176 600-46891 100-23914 100-90963
I want to convert the above table in the following form:
(Product_Barcode_V2)
ID Source Type Barcode
1 NJ INS 600-30000
1 NJ LIC 600-28426
1 TX INS NULL
1 TX LIC 100-4260
2 NJ INS 600-35476
2 NJ LIC 600-36621
2 TX INS 100-23903
2 TX LIC 100-75414
3 NJ INS 600-37176
3 NJ LIC 600-46891
3 TX INS 100-23914
3 TX LIC 100-90963
Can anyone please help me write this Insert SQL for this.. Any help gretly appriciated.
Thanks,
Mike