If we want to insert record from another table we can write it in following ways.
INSERT INTO TABLE1
(Col1,Col2)
SELECT Col1,Col2 FROM TABLE2
What if we want to insert all columns value
INSERT INTO TABLE1
SELECT * FROM TABLE2
But if we want to insert identity column value then we have explicitly mention all columns name.
August 3, 2011
INSERT all columns of a table into another table
Subscribe to:
Post Comments (Atom)
The Tech Pursuit
Keep asking better questions.
© Shatrughna Kumar. The Tech Pursuit.
Views expressed here are personal and do not represent any employer.
No comments:
Post a Comment