Skip to content

Instantly share code, notes, and snippets.

@ls404
Created June 27, 2017 06:07
Show Gist options
  • Select an option

  • Save ls404/6f8429407d74d8bd31d9d2dbc975aa4e to your computer and use it in GitHub Desktop.

Select an option

Save ls404/6f8429407d74d8bd31d9d2dbc975aa4e to your computer and use it in GitHub Desktop.
DECLARE @s VARCHAR(50)= 'City-Of-Style'
SELECT SUBSTRING(@s,0,CHARINDEX('-',@s,0)) AS firstPart,
SUBSTRING(@s,CHARINDEX('-',@s,0)+1,LEN(@s)) AS secondPart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment