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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2000-12-19 : 12:57:12
|
Holly writes "DB Version: SQL Server 7.0 sp1 OS: MS NT 4 sp?
I want to be able to merge two tables into one using a stored procedure if possible.
I have two tables with a common set of columns. (Common meaning same column name and datatype/size.) I won't know the names of those common columns or how many columns between the two tables are common.
These two tables can also have additional columns as well.
How can I merge these two tables' structures creating a new table and then populate the resulting table with the applicable data from the existing tables? Example: ----Table One------
[db1]..[Table One] ColA varchar(25) -- Same as ColA in db2 ColB int -- Same as ColB in db2 Colx char(10) -- Different Col -------------------
----Table Two ----- [db2]..[Table Two] ColA varchar(25) -- Same as ColA in db1 ColB int -- Same as ColB in db1 Col9 int -- Different Col
------------------- The resulting table I want is:
[db3]..[MergedTbl] ColA varchar(25) ColB int colx char(10) Col9 int
And I want to populate the resulting table with the data from the previous two tables.
Thanks Much In Advance!!! holly" |
|
|
|
|
|