Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/05/2008, 08:43
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
Re: [B]procedimiento sql server[/B]

Hola,

Esta la opcion de preguntar si existe o no el registro, no te hace falta un cursor.

Código:
begin

if exists (SELECT id From imagenes_vs_temas where id_foto in (bla bla bla))
  begin
    update algo
  end
else
  begin
    insert algo
  end

end
GO
Saludos