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.
| Author |
Topic |
|
haler
Starting Member
13 Posts |
Posted - 2011-12-20 : 23:48:11
|
| Hi what i am trying to do is insert all my data from multiple tables into the one table. The fields have the same naming convention but for some tables the field might not exist. I have a table with a list of all the table names i want to insert into the master table.so for example my master table would look like thiscompany | name | address | phone | fax | email | facebookand then i have multiple tables with the same field names but some fields might not exist so it would be like sotable 1company | name| phone | faxtable 2company | name | addresss | phone | emailtable 3company | name | address | facebook | phoneAm i able to loop through my list of tables and insert the contents into the appropriate fields and how would i go about doing so? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
haler
Starting Member
13 Posts |
Posted - 2011-12-21 : 00:45:46
|
| Is there a more streamlined way of doing this, maybe looping through my list of table names? because I may have hundreds of tables that need to be inserted.Also i dont think a join is what i am looking for, It is more like a union but union wont do what i want to do. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|