Error entering data into tables in SQL Server

I get errors when pasting this data into a table.

INSERT INTO Course (Course_ID,Course_Name) VALUES ('2019','CS'); VALUES ('1033','science'); VALUES ('1055','history'); VALUES ('3001','French'); 

Here are the details of creating the table. Course:

 CREATE TABLE ( Course_ID INT NOT NULL, Course_Name VARCHAR(30) NOT NULL, PRIMARY KEY (Course_ID) ); 
+5
source share
1 answer

You do not need to repeat the values , you need to use a comma between sets of values, and a semicolon to complete the statement is optional (but good practice).

 INSERT INTO Course (Course_ID,Course_Name) VALUES ('2019','CS') , ('1033','science') , ('1055','history') , ('3001','French'); 

Link:


demo demo version: http://rextester.com/DBYKYI20580

+5
source

Source: https://habr.com/ru/post/1266481/


All Articles