Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/08/2011, 18:36
Avatar de matanga
matanga
 
Fecha de Ingreso: octubre-2007
Ubicación: España
Mensajes: 1.091
Antigüedad: 16 años, 6 meses
Puntos: 85
Respuesta: Duda FOR XML PATH

No es muy elegante, pero debería funcionar

Código:
if exists ( select c.nombreCliente as "Columna"
from clientes c
where c.clienteCod = 1 )

select c.nombreCliente as "Columna"
from clientes c
where c.clienteCod = 1
FOR XML PATH(''), TYPE

else

select ' ' as "Columna"
FOR XML PATH(''), TYPE
Saludos