sql server - Error Inserting Data into tables -


i getting errors when inserting these data table course.

insert course (course_id,course_name) values ('2019','cs'); values ('1033','science'); values ('1055','history'); values ('3001','french'); 

here details creation of table course:

create table  (   course_id int not null,   course_name varchar(30) not null,   primary key (course_id) ); 

you not need repeat values, need use comma between sets of values, , semicolon terminate statement optional (but practice).

insert course (course_id,course_name) values    ('2019','cs') , ('1033','science') , ('1055','history') , ('3001','french'); 

reference:


rextester demo: http://rextester.com/dbykyi20580


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -