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 2000 Forums
 Transact-SQL (2000)
 Insert from Other Table

Author  Topic 

ann
Posting Yak Master

220 Posts

Posted - 2007-04-10 : 12:16:25
I want to insert data from another table into it's own column. Example:
Table1:
table1ID, Emp, Dept
1 Joe Smith Accounting
2 Jane Doe IT

Table2:
Table2ID Table1ID AdditionalDept
1 1 HR
2 1 Management


Result:
Emp Dept AdditonalDept
Joe Smith Accounting HR
Management
Jane Doe IT

Basically the additional departments have been combined into the one field. Is this even possible?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-04-10 : 12:18:50
Yes, search for "Concat records" function here at SQLTeam.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -