I have a table for a competition as follows:CREATE TABLE [Competition] ( [CompID] [int] IDENTITY (1, 1) NOT NULL , [FirstName] [varchar] (50) NOT NULL , [LastName] [varchar] (50) NOT NULL , [Cellno] [char] (10) NOT NULL , [Email] [varchar] (50) NOT NULL , [Answer1] [bit] NOT NULL , [Answer2] [bit] NOT NULL , [Comment] [varchar] (255) NULL )GO
I am using the following statement to draw the winner:Declare @MaxValue int, @RandomNumber1 float Select @MaxValue = max(CompID) from Competition Select @RandomNumber1 = rand() * @MaxValueSelect TOP 1 * From Competition Where CompID >= @RandomNumber1
1 or 2 people entered who should not have so I delete them. This now creates a gap in CompID. How do I renumber this field? Is there something like DBCC CHECKIDENT?