Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/05/2009, 20:13
dlfQuetzalcoatl
 
Fecha de Ingreso: abril-2009
Mensajes: 40
Antigüedad: 15 años, 11 meses
Puntos: 0
Respuesta: crear funcion: cual es mi error ???

otra opcion seria usar el siguiente codigo:


DECLARE @ULTIMOID INTEGER

--en donde SCOPE_IDENTITY() te regresa el id del ultimo elemento insertado en la tabla
@ULTIMOID=SCOPE_IDENTITY()

si necesitas esta valor mas uno quedaria algo como lo siguiente:

DECLARE @ULTIMOID_MASUNO INTEGER

@ULTIMOID_MASUNO =SCOPE_IDENTITY()+1