I have next tables: Sales, Products, Brands
I want to display all sales for products belonging to a list of brands (Ids) ' ',2,3,5,6,' OR ALL Brands (if this list is empty)
Execution sample
exec dbo.sp_JoinTechnique ',2,3,5,6,'
So, I've tested on my data and works better than the regular way (maybe because of the indexes) but I want to know your opinions too.
Enjoy!