Tema: Consulta SQL
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/07/2012, 21:52
GeriReshef
 
Fecha de Ingreso: julio-2012
Ubicación: Israel
Mensajes: 360
Antigüedad: 11 años, 9 meses
Puntos: 40
Respuesta: Consulta SQL

Intenta eso:
Código SQL:
Ver original
  1. DECLARE @S VARCHAR(MAX);
  2. SELECT  @S='López*Pérez,Juan';
  3.  
  4. SELECT  LEFT(@S,CharIndex('*',@S)-1),
  5.         SUBSTRING(@S,CharIndex('*',@S)+1,CharIndex(',',@S)-CharIndex('*',@S)-1),
  6.         RIGHT(@S,Len(@S)-CharIndex(',',@S));
__________________
El Castellano no es mi lengua materna: discúlpenme por los errores gramaticales.
Mi blog