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.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Updating a table with data from other table

Author  Topic 

bl4tech
Starting Member

2 Posts

Posted - 2007-10-20 : 09:30:50

I apologize if my question sounds too basic...

I have two tables as described below:

tblONE
----------
ID Number(9,0) not null - Primary key
Holding Char(250)

tblTWO
----------
ID Number(9,0) not null - Repeatable
Holdind Char(30)

Data examples of tblONE (see that Holding fields are empty)
------------------------------------
ID Holding
001
002
003
004
005

Data examples of tblTWO
------------------------------------
ID Holding
001 v.1, n.1, 1989
002 v.22, n.13, 1990
002 v.23, n.14, 1991
003 v.56, n. 2, 2002
004 v.87, n. 20, 2001
004 v.54 , n. 3, 2006
004 v.55, n. 4, 2007
005 v.3, n. 5, 1998

What I want is updating HOLDING field of tblONE with the content of HOLDING field from tblTWO, like that:
(see that ID field is UNIQUE in tblONE and it can occours more than once in tblTWO)

NEW Data examples of tblONE
--------------------------------------------
ID Holding
001 v.1, n.1, 1989
002 v.22, n.13, 1990 -- v.23, n.14, 1991
003 v.56, n. 2, 2002
004 v.87, n. 20, 2001 -- v.54, n. 3, 2006 -- v.55, n. 4, 2007
005 v.3, n. 5, 1998


TIA,

Bill

Kristen
Test

22859 Posts

Posted - 2007-10-20 : 10:04:57
Duplicate of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=91319
Go to Top of Page
   

- Advertisement -