kuroi could you advise me as you seem to have a good understanding of this mod.
Further to my last message this is driving me mad, there doesn't seem to be a logic to how the attribute values are indexed in the 'stock_attributes' column.

If I enter via SBA in admin I get some attributes for the example of the Mysql table:

PHP Code:
1125    1075    14024,14025    2    P/GAB/D/BL/350
1126    1075    14013
,14025    1    P/GAB/D/BL/360
1127    1075    14014
,14025    1    P/GAB/D/BL/370
1128    1075    14015
,14025    3    P/GAB/D/BL/380
1129    1075    14016
,14025    1    P/GAB/D/BL/390
1131    1075    15085
,14025    3    P/GAB/BK/D/410
1132    1075    15086
,14025    4    P/GAB/BK/D/420 
And some :
PHP Code:
1166    1075    14025,15084    0  stockcode_to_add     
1167    1075    14025
,16527    1   stockcode_to_add 
As you will see they are all for the same product, I have size and fitting(Ref 14025) as attr's, First Size then Fitting(Ref 14025). In the second example it has been reversed so it is Fitting(Ref 14025) and Size. I can not see why SBA does this, can you shed a light on it. I have added a custom field in this table for a stock_code which I add remotely for updating the stock levels.

Many thanks
Andrew