How to get SQL query for product insert in Magento 2 ?

I have multiple products around 10 Lakhs so i want to insert it using SQL query.

But how will i get the insert query of the product ?

Any Help is Appreciated.

1 Answer 1


you can import data from csv file https://docs.magento.com/user-guide/system/data-import.html

otherwise you can create a command object using Magento\Framework\Model\ResourceModel\Iterator to import huge amount of records.

example code: http://www.rosenborgsolutions.com/collection-walk-iterator.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.