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 to Update table from another table 1

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US
Hi I have two tables

Tbl1 Name = Memos
Memo (text)
MemoID (Int)

Tb22 Name members
lastname (nvarchar(50))
firstname (nvarchar(50))
oldindx (int)
indx (int)

I want to update/set TB1.memoID = Tbl2.indx

BTW TBL1.memoid = tbl2.oldindx


Thanks

-dan
 
If I am seeing everything...

update tbl1
set TBl1.memoID = Tbl2.indx
from tbl1
join tbl2
on TBL1.memoid = tbl2.oldindx

You might want to backup TBL1 first.

Simi


 
Thanks Simian,

Worked Great I appreciate it :)

-dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top