If we need some information that can be achieved only through dynamic query then should not it be written in the application code directly (in DAL) rather than in the stored procedure?
Because the benefit we achieve from SP is already lost if we use dynamic query in it which is the already saved execution execution plan along with it.