title: How to extract catalog name from connection string using TSQL?
body: <p>Say I have the following string value:</p>
  
  <pre><code>declare @cs nvarchar(100) = 
     'Data Source=server\instance;Initial Catalog=MyDatabase;Integrated Security=True';
  </code></pre>
  
  <p>What is the T-SQL to extract the string <code>MyDatabase</code> from <code>@cs</code>?</p>
  
  <p>Alternately, what T-SQL function(s) should I look at for a means to figure it out for myself?</p>