'Drupal 7 I need to change the sku directly in the commerce_product table and want to know if this is possible to do without creating a drush script

I need to change the sku directly in the commerce_product table and want to know if this is possible to do without creating a drush script.



Solution 1:[1]

This can be done by changing the same sku in both commerce_product & commerce_product_revision then truncating all of the cache tables.

UPDATE `commerce_product` SET `sku` = 456 WHERE `sku` = 123;

UPDATE `commerce_product_revision` SET `sku` = 456 WHERE `sku` = 123;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ziggy