How to Set Max length of SKU in magento

1. STOCK KEEPING UNIT – SKU

2. By default magento having the Maximum length of SKU is 64. So it won’t take much character.

3. If you try to import more than that legth of SKU , you may get issue.For that what we want to do, we should make increase the maximum of SKU legth.

4. When you run the below query, you come to know what the size of SKU field.
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN (‘sku’) AND TABLE_SCHEMA = ‘Jute_database_name’;

From the “catalog_product_entity” table, by default it will be varchar(64). But rest of the table’s like quote , order ,etc tables
sku size is 255.

5. catalog_product_entity is based table for SKU. So we have to increase the size of length from this table.

6. Instead of that, there is option to make increase size from below file. Will override this file
app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php
Change const SKU_MAX_LENGTH = 64; to const SKU_MAX_LENGTH = 255;

———————————————————————————————————————————————————————————————-

Corner of Blog:

“Saving Trees Where You Live”

———————————————————————————————————————————————————————————————-