I have added the parent categories and subcategories in the 'Category' table. Structure of my categories are as follows Parent -Child1 -Child2 When I add this through Administration panel it works. However I have written a stored procedure to load the category table and when the data is added to it, it does not show up the 'Child2'.