I utilized SQLCMD so that we could parameterize the databases and not use dynamic SQL. If you're not familiar with SQLCMD mode, please read here . In SSMS, you can turn on SQLCMD mode by going to Query > SQLCMD Mode
I love SSMS Templates , and before Snippets , I used for both reasons. To access SMSS Templates, go here: View>Template Explorer or Ctrl+Alt+T . I use them as a place to store those infrequently used SQL Queries. Those queries that a DBA doesn't want rewrite and reinvent or spending a lot of time remembering where they were last saved.