I would greatly appriciate your suggestions and advice to find a sulution to following,
I have a table which is maintain by current application comprising "pack code/style/vendor/size/qty".
The pack code is automatically assign for the cobination of style/vendor/color/size/quantity.(exisitng application)
Now there is a manual process running where user create "style/vendor/color/size/qty" text file and i am importing these records into following working table. Then i am assigning PACK_CODE from existing table (Application)
base on the style/Vendor/Color/size/qty.(used inner join with application table to update my work table)
Question:
If there is no pack_code exist for the cobination of style/vendor/color/size/qty, then i have to generate a pack code seperately (sequential number used diffrent range).
I used Identity table to generate pack_code. But, i have probelem in generating and assigning pack code back to my working
table? i am quite new to T-SQL and never used a cursor befor.
working table:
Pack Style Vendor color size qty
02365 455511262 12398 002 920 1
02365 455511262 12398 002 930 2
02365 455511262 12398 002 950 2
02365 455511262 12398 002 960 1
455511262 12398 101 920 1
455511262 12398 101 930 2
455511262 12398 101 950 3
455511262 12398 101 960 2
02372 455511262 12398 404 920 1
02372 455511262 12398 404 930 2
02372 455511262 12398 404 950 2
02372 455511262 12398 500 960 1
455511262 12398 500 920 1
455511262 12398 500 930 2
455511262 12398 500 950 2
455511262 12398 500 960 1
Pack_code
Seq_id Pack_code (Identity/ seed 1)
1 40000
Thank you.
I have a table which is maintain by current application comprising "pack code/style/vendor/size/qty".
The pack code is automatically assign for the cobination of style/vendor/color/size/quantity.(exisitng application)
Now there is a manual process running where user create "style/vendor/color/size/qty" text file and i am importing these records into following working table. Then i am assigning PACK_CODE from existing table (Application)
base on the style/Vendor/Color/size/qty.(used inner join with application table to update my work table)
Question:
If there is no pack_code exist for the cobination of style/vendor/color/size/qty, then i have to generate a pack code seperately (sequential number used diffrent range).
I used Identity table to generate pack_code. But, i have probelem in generating and assigning pack code back to my working
table? i am quite new to T-SQL and never used a cursor befor.
working table:
Pack Style Vendor color size qty
02365 455511262 12398 002 920 1
02365 455511262 12398 002 930 2
02365 455511262 12398 002 950 2
02365 455511262 12398 002 960 1
455511262 12398 101 920 1
455511262 12398 101 930 2
455511262 12398 101 950 3
455511262 12398 101 960 2
02372 455511262 12398 404 920 1
02372 455511262 12398 404 930 2
02372 455511262 12398 404 950 2
02372 455511262 12398 500 960 1
455511262 12398 500 920 1
455511262 12398 500 930 2
455511262 12398 500 950 2
455511262 12398 500 960 1
Pack_code
Seq_id Pack_code (Identity/ seed 1)
1 40000
Thank you.