Created
June 27, 2017 06:07
-
-
Save ls404/6f8429407d74d8bd31d9d2dbc975aa4e to your computer and use it in GitHub Desktop.
Split string on only first occurence of character/delimiter https://stackoverflow.com/questions/13430905/split-string-on-only-first-occurance-of-character-delimiter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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