I don't know about you, but passing parameters to sp_executesql via variables was never my favorite (I'm sorry if it was/is yours).
The above script offers a dynamic keyword replacement in a query string, by storing the keyword-value pairs in a @keywords table (for one-time use, which can be changed to permanent table for re-use).
The @sql string represents a simple select from the temporary table created on top.
The placeholders in the @sql string are delimited by '<%' and '%>' and are replaced by values in the @keywords table by matching the keyword with the placeholders:
select @sql=replace(@sql,'<%'+keyword+'%>',value) from @keywords...
Besides the fact that the keywords can be stored permanently and reused, I find it pretty cool that there is no need to iterate over the @sql string to replace all the placeholders.