rOcKiNg RhO
rOcKiNg RhO

Reputation: 631

Sql insert data from one table to another

i have a doubt. i need the syntax for SQL SERVER – how to Insert Data From One Table to Another Table?

Upvotes: 2

Views: 2778

Answers (2)

Mamun
Mamun

Reputation: 1

Insert INTO Table1 (UserName) (Select UName From Table2 b Where Table1.EID = b.EID)

But Showing Message:

The multi-part identifier "Table1.EID" could not be bound.

Upvotes: 0

John Woo
John Woo

Reputation: 263683

use INSERT INTO..SELECT statement

INSERT INTO table2 (col1,...)
SELECT col1,...
FROM table1

Upvotes: 7

Related Questions