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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE FROM ????

Status
Not open for further replies.

mooki

Programmer
Aug 1, 2000
32
0
0
IL
Im looking for a way to update one table from another
without specifying all the columns of the tables.

like : update tb1
set tb1.* = tb2.*
from tb2

somthing like that ? is there any way of doing it ? or i will have to write all columns ???
 
Why not delete all rows from tbl1 and then
... 'Insert into tbl1 select * from tbl2'.

since they seem to have the same structures.
 
Hi
the syntax is
-----------------------
update tb1
set tb1.onerow = tb2.otherrow
from tb2
where
tb1.oneID = tb2.otherOrTheSameID
--------
in 'where' statement you may put many conditions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top