title: SQL Server: any equivalent of strpos()?
body: <p>I'm dealing with an annoying database where one field contains what really should be stored two separate fields.  So the column is stored something like "The first string~@~The second string", where "~@~" is the delimiter.  (Again, I didn't design this, I'm just trying to fix it.)</p>
  
  <p>I want a query to move this into two columns, that would look something like this:</p>
  
  <pre><code>UPDATE UserAttributes
  SET str1 = SUBSTRING(Data, 1, STRPOS(Data, '~@~')),
      str2 = SUBSTRING(Data, STRPOS(Data, '~@~')+3, LEN(Data)-(STRPOS(Data, '~@~')+3))
  </code></pre>
  
  <p>But I can't find that any equivalent to strpos exists.</p>