You have a column on your table [appointment] which has been defined as IDENTITY but in your code you are attempting to assign an explicit value to it.
Don't - the whole point of IDENTITY columns is that the database will generate those values for you.
An example:
create table Demo
(
myID int IDENTITY(1,1),
otherData varchar(30)
)
If I attempt to put data into that table using this
insert into Demo values
(1,'first datum'),
(2,'second datum'),
(3,'third datum')
then I will get an error reported
Quote:
Msg 8101, Level 16, State 1, Line 1
An explicit value for the identity column in table 'Demo' can only be specified when a column list is used and IDENTITY_INSERT is ON.
Instead, I need to use
insert into Demo values
('first datum'),
('second datum'),
('third datum')
then when I select I get
myId otherData
1 first datum
2 second datum
3 third datum