I\'m new to SQL, (using SQL 2008 R2) and I am having trouble inserting multiple rows into a single column.
I have a table named Data
and this is what I
Kindly ensure, the other columns are not constrained to accept Not null
values, hence while creating columns in table just ignore "Not Null" syntax. eg
Create Table Table_Name(
col1 DataType,
col2 DataType);
You can then insert multiple row values in any of the columns you want to. For instance:
Insert Into TableName(columnname)
values
(x),
(y),
(z);
and so on…
Hope this helps.
to insert values for a particular column with other columns remain same:-
INSERT INTO `table_name`(col1,col2,col3)
VALUES (1,'val1',0),(1,'val2',0),(1,'val3',0)
I believe this should work for inserting multiple rows:
INSERT INTO Data ( Col1 ) VALUES
('Hello'), ('World'),...