We help IT Professionals succeed at work.
Get Started

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

747 Views
Last Modified: 2012-05-09
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
Comment
Watch Question
CERTIFIED EXPERT
Expert of the Quarter 2010
Expert of the Year 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE