title: Need to capture database name when error occurs with sp_msforeachdb
body: <p>I am running a dynamic sql command with sp_msforeachdb for each database. However the command bombs for a certain database. </p>
  
  <p>How is '?' used to display the database name when the error happens? I tried using it in a Catch statement but my syntax is wrong.</p>