Código SQL:
Ver originalCREATE TABLE #temp
(
valor VARCHAR(20)
)
INSERT INTO #temp VALUES ('AA-S1')
INSERT INTO #temp VALUES ('AA-S2')
INSERT INTO #temp VALUES ('AA*********')
SELECT CASE WHEN charindex('-',valor)>=1 THEN REPLACE(valor,'-','') ELSE valor END AS campo FROM #temp
Resultado:
campo
AAS1
AAS2
AA*********