I'm making a sequence number form Certificate of Insurance booklet given to the agents so that the CI numbers can be tracked. My code is attached below:
- CREATE PROCEDURE [dbo].[CI_SEQUENTIAL_Number]
- (
- @StartingNumber int,
- @EndingNumber int,
- @Header int
- )
- AS
-
- DECLARE @start int
- DECLARE @end int
-
- SELECT @start = @StartingNumber, @end = @EndingNumber
-
- WHILE @start <= @end
- begin
-
- INSERT INTO dbo.tblSeriesDetails
-
- (SeriesNumbers)
-
- VALUES(@start)
-
- SET @start = @start + 1
-
- where SeriesHeader_Id = @Header error in this area.
-
- END
without the where clause, it is running but when I insert the where clause i got an error "
Msg 156, Level 15, State 1, Procedure SEQUENTIAL, Line 25
Incorrect syntax near the keyword 'where'." Still newbie and still acquiring knowledge in sql server. Thanks for any help.