Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql server 2000, adding rows from table1 to table2 1

Status
Not open for further replies.

duchovnick

Programmer
Jan 4, 2007
115
IL
Hi,
I'm trying to add records from table2 to table1. Table1 has more columns then table2 (two tables are of different structure) and table2's column names of columns exist in table1 carry different names. I use the following code:
Code:
INSERT INTO table1(firstname, lastname, city, address1, address3, zip, phone1)
SELECT FROM table2 (name, lastname, city, street, number, zip, extension+'-'+phone)
And the following error message shows up:
Incorrect syntax near the keyword 'FROM'.
.
Can anyone help me with that?
 
change this --

SELECT FROM table2 (name, lastname, city, street, number, zip, extension+'-'+phone)

to this --

SELECT name, lastname, city, street, number, zip, extension+'-'+phone FROM table2

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top