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.
There are many other facets of stored procedures to consider besides their execution plan caching features, so I don’t think its fair to dismiss their use simply because they are going to contain an ad-hoc query.
(Also worth noting that a properly formed bit of dynamic SQL is no barrier to execution plan reuse)