Tema: query
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/08/2011, 07:29
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: query

@declare variable varchar(max)
set @variable=1

if @variable=1 then
begin
select case when datos=1 then 'si' else 'no' end as dato from tabla
end
else
begin
select case when datos=0 then 'no' else 'si' end as dato from tabla
end


Algo asi??
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me