Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

DBCC CHECKIDENT ([certifica.ActividadesDiscentes], RESEED, 1)

i have this sp
alter procedure [certifica].[InsertarEnCertifica]
   @CodigoActividad numeric (38,0)
 
as

DBCC CHECKIDENT ([certifica.ActividadesDiscentes], RESEED, 1)

INSERT INTO certifica.ActividadesDiscentes (CodigoActividad, CodigoDiscente, Constancia)
SELECT distinct DC.CODCURSO, U.login, '1'
from
      intranetamag.Usuario U, intranetamag.DiscentexCurso DC ,
      intranetamag.DiscentexCursoxModulo DCM,intranetamag.EstadoDiscente ED
where
      Dc.CODCURSO = @CodigoActividad
      and DC.LOGIN=U.LOGIN and Dc.CODESTADODISCENTE=ED.CODESTADODISCENTE
      and      DC.LOGIN=DCM.LOGIN and DC.CODCURSO=DCM.CODCURSO

when
CREATE TABLE [certifica].[ActividadesDiscentes](
      [CodigoActividadesDiscentes] [int] IDENTITY(1,1) NOT NULL,

every time you call this store the column [CodigoActividadesDiscentes] should begin in 1.
In the first call starts at 1, but the second call starts at 2, I want to always start in the value of a 1
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial