ALTER PROCEDURE [dbo].[Nop_CustomersGet_AllChildren] ( @CustomerID int, @StoreID uniqueidentifier ) AS BEGIN With ChildCustomer As ( Select c.* From Nop_Customer c Where CustomerID = @CustomerID and storeID = @StoreID Union ALL Select c2.* From Nop_Customer c2 Inner Join ChildCustomer On ChildCustomer.CustomerID = c2.[ParentCustomerID] ) Select * from ChildCustomer END
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
20 Experts available now in Live!