Hi Dixen,
If I understand your post correctly, you have two tables with different data but a related column, Name? Is this correct? Do you want to create a new table that contains data from both existing tables? Or do you just want to select columns from matching rows both tables into one row?
How many columns do each of the tables have? Is there any duplication of columns in the two tables?
To Select all columns from both tables You'll want to JOIN the tables on the Name column. You should specifically list column names in the select list to avoid duplication of column names.
Select
a.name, a.col2, a.col3, ..., a.colN,
b.col2, b.col3, ..., b.colN
From Table1 As a
Inner Join Table2 As b
On a.name=b.name
You can convert the Seelct query to a make table query to create the new table with all of the cloumns.
Select
a.name, a.col2, a.col3, ..., a.colN,
b.col2, b.col3, ..., b.colN
Into Table3
From Table1 As a
Inner Join Table2 As b
On a.name=b.name
Run the query to create the table and insert all of the data.
Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions in the SQL Server forum. Many of the ideas apply to all forums.