Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help please Need to Insert from three tables

Author  Topic 

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2009-05-21 : 11:46:40
I created a new table to consolidate three old tables. The new tables has two new columns different from the three older tables.

Name of the NEW Table is: Consolidate_Approver_Table
Columns as follow: ID, LOCATION, APPLICATION, APPROVER_MAIN, APPROVER_BACKUP, FYI, SUBMITTED BY.

OLD TABLES ARE: Approver_North_America, Approver_Europe, Approver_Central_America.
Columns are as follow: APPLICATION, APPROVER_MAIN, APPROVER_BACKUP, FYI, SUBMITTED BY.


How can I insert all the fields into the new Table. P.S. ID in the new table is the auto sequence generate by sql.

Thank you very much for your help

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-21 : 12:34:33
1. Why do you have multiple alias?
2. How is the "auto sequence" generated? Calculated column? Other means?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2009-05-21 : 15:21:26
Previously the Tables was created by location
OLD TABLES ARE: Approver_North_America, Approver_Europe, Approver_Central_America.

I think this unnecesary we can have one Table that handle all locations by just adding a Location Column. Since they have repetitive records, I set up the new table with a unique ID under Identity Specification incremet by 1. I believe this is an auto generate sequencial number per record. Example 1, 2, 3, 4, etc..etc..

Any ideas of how can I insert all this tables into my new one.

Thanks Peso.
Go to Top of Page
   

- Advertisement -