Link to home
Start Free TrialLog in
Avatar of Marcus Aurelius
Marcus AureliusFlag for United States of America

asked on

INSERT contents of one table...into an existing table....?

Experts:

Can I get the syntax for entering TableA into TableB. TableA contains the historical data and TableB has new data that needs to be populated INTO TableA.

Identical Columns....datatypes...etc..etc..

Thanks

MikeV
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Insert Into TableA (Col1, Col2, Col3....)
Select Col1, Col2, Col3...
From TableB
Avatar of Marcus Aurelius

ASKER

thanks....so there isn't a way to use a WILDCARD Character...like

INSERT INTO TableB ( col1, col2, col3 .... )
  SELECT *   <---------- ???
   FOM tableA
   WHERE ...
if both tables are REALLY identical, then you could do this:

INSERT INTO TableB
  SELECT *
   FOM tableA
   WHERE ...

note that it is usually dangerous for be used in production...
Ok..I would be running this SQL script manually...and the data tables are IDENTICAL in column names etc...

Thanks for the information....