16

Im using SQL Server 2005.

I have a table1 with 3 columns. And table2 with 4 columns.

I want to insert the records from table1 into table2.

But I dont want to insert into column1 from table2.

I want to start inserting from column2 on.

What can i do? Thanks...

2

5 Answers 5

32
insert into table2 ( col2, col3, col4 ) select col1, col2, col3 from table1 
Sign up to request clarification or add additional context in comments.

Comments

5

You can combine select and insert in order to do this. This is how:

insert into table2 (col2, col3, col4) select col1, col2, col3 from table1 

Comments

2

You will just need to use a SELECT...FROM in your INSERT to select the columns you want.

INSERT INTO table2 ( column2, column3, column4 ) SELECT column1, column2, column3 FROM table1 

Comments

1
INSERT INTO Table2 (column2,colum3,column4 ) SELECT column1,column2,column3 FROM Table1 

Comments

1
into into table2 (column2,......) select column2 ..... from table1 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.