SELECT LEFT(columnname, Charindex('-', columnname) - 1) as leftcolumn, RIGHT(columnname, Charindex('-', Reverse(columnname)) - 1) as rightcolumn FROM table1
SELECT LEFT(id, CHARINDEX('-',id)-1) as ID1, RIGHT(id, CHARINDEX('-',id) - 2) as ID2 FROM [Table_2]
ID1 ID2 12345 1234
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)