Hello all,<BR><BR>I tried to create a store procedure that enable the table to reset the id. For example, if a user is already have a record in the table with regid = 1 (identity). And he tries to enroll one more time with the same login (email and password), then his Regid should be 1 instead of 2, and then the ResetRegid field should be set to "yes" for regid=2. Here is how my store<BR>proc look like, but it didn&#039t work. Please help!!!!! Thank you in advance.<BR><BR>Ps: I assume that @oldRegid=1 and @newRegid=2<BR><BR>&#039&#039&#039&#039&#039&#039& #039&#039&#039&#039&#039&#039&#039&#039&#039&#039& #039&#039&#039&#039&#039&#039&#039&#039&#039&#039& #039&#039&#039&#039&#039&#039<BR>CREATE PROCEDURE ce_ResetRegid<BR>@oldRegid int,<BR>@newRegid int,<BR>@email varchar(15),<BR>@pwd varchar(12)<BR>AS<BR>select @newRegid=regid, email, pwd from usermast<BR>where email=@email and pwd=@pwd<BR><BR>select @oldRegid = regid , email, pwd from usermast<BR>where email=@email and pwd=@pwd<BR><BR>if @oldRegid &#060;&#062; @newRegid then<BR> update usermast<BR> set ResetRegid = "yes"<BR> where regid = @oldRegid<BR>end if<BR>select @oldRegid<BR>