I think you are doing it wrong way.
Instead of storing variation numbers for each master in master table, you need to put master product number in each of its variation.
For eg.
Master Product table
ProductID Name
--------------------------
1 Car
2 Shirt
Product Variation table
VariationID ProductID VariationScheme
------------------------------------------------------
1 1 Ford
2 1 Santro
3 2 Park Avenue
4 2 Raymonds
in this way, you wont have to store variation IDs in some arcane way in master table.
Harsh Athalye
India.
"Nothing is Impossible"