TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jes Sie
742
1.2k
281k
Generating a Sequential Number from SQL SERVER
Mar 25 2017 11:09 AM
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.
Reply
Answers (
4
)
when inserting records from grid to database first row inser
How do I write a C# program that can run any windows system.