Insert multiple rows into single column

0 votes

I am having problems adding numerous data into a single column because I am new to SQL (using SQL 2008 R2).

This is what I'm trying to do with my Data table.

INSERT INTO Data ( Col1 ) VALUES
('Hello', 'World')

This question's code was used to create it, however I only want to use one column instead of two, as is the case with many other examples I've discovered online. Why am I misusing this?

Sep 4, 2022 in Database by Kithuzzz
• 38,000 points
1,492 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

To update a specific column's data while keeping the other columns unchanged: -

INSERT INTO `table_name`(col1,col2,col3)
VALUES (1,'val1',0),(1,'val2',0),(1,'val3',0)

I hope this helps you.

answered Sep 5, 2022 by narikkadan
• 63,600 points

edited Mar 5
0 votes
INSERT INTO Data ( Col1 ) VALUES
('Hello'), ('World');
answered Jun 21, 2023 by Vikky

edited Mar 5

Related Questions In Database

0 votes
1 answer

Inserting multiple rows in a single SQL query?

In SQL Server 2008, multiple rows can ...READ MORE

answered Feb 10, 2022 in Database by Vaani
• 7,070 points
1,142 views
0 votes
1 answer

Excel - Combine multiple columns into one column

In Excel, how can I concatenate (combine) ...READ MORE

answered Mar 30, 2022 in Database by gaurav
• 23,260 points
3,816 views
0 votes
1 answer

Excel - how to calculate sum of multiple rows into different columns

The AutoSum button or formula can be ...READ MORE

answered Apr 4, 2022 in Database by Edureka
• 13,690 points
11,477 views
0 votes
1 answer

Can I have multiple primary keys in a single table?

A Table can have a Composite Primary Key which ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,830 points
4,042 views
0 votes
1 answer

How to insert date values into table?

You have to convert the literal to ...READ MORE

answered Feb 18, 2022 in Database by Vaani
• 7,070 points
3,571 views
0 votes
1 answer

Insert into ... values ( SELECT ... FROM ... )

Try: INSERT INTO tableA ( column_1 ) SELECT ...READ MORE

answered Feb 23, 2022 in Database by Neha
• 9,020 points
1,832 views
0 votes
1 answer

How to delete duplicate rows in SQL Server?

To answer your query, note that CTEs ...READ MORE

answered Feb 10, 2022 in Others by Soham
• 9,710 points
1,252 views
0 votes
1 answer

Rename column SQL Server 2008

Use sp_rename EXEC sp_RENAME 'TableName.PreviousColumnName' , 'NewColumnName', 'COLUMN' See: SQL SERVER ...READ MORE

answered Feb 23, 2022 in Database by Vaani
• 7,070 points
797 views
0 votes
0 answers

How to update Identity Column in SQL Server?

With 200 records currently, I want to ...READ MORE

Aug 9, 2022 in Database by Kithuzzz
• 38,000 points
1,569 views
0 votes
0 answers

Query to check index on a table

I want a query to see if ...READ MORE

Aug 11, 2022 in Database by Kithuzzz
• 38,000 points
574 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP