title: Find substring/charindex T-sql
body: <p>I have the following variable.</p>
  
  <pre><code>DECLARE @TestConnectionString varchar(255) = 'Data Source=123.45.67.890;User ID=TestUser;Password=TestPassword;Initial Catalog=TestCatalogName;Provider=SQLNCLI11.1;Persist Security Info=True;Auto Translate=False;'
  </code></pre>
  
  <p>I want to separate out each property's values from this connection string. </p>
  
  <p>I am sure that I have to use <code>SUBSTRING</code> and <code>CHARINDEX</code> but not sure how. I don't want to hard-code the length for each property as <code>user_id</code> could be <code>"Comeonedude"</code></p>
  
  <p>Can someone show me how I can extract few of these properties as an example? </p>
  
  <p>In meanwhile, I will try to see if I can figure out anything.</p>
  
  <p>Thank you</p>