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.
Author |
Topic |
gangadhara.ms
Aged Yak Warrior
549 Posts |
Posted - 2011-06-13 : 04:37:25
|
Dear All,I need to import a values from a temp table to multiple tables.Here i need to do a look up to reference table,kindly suggest me the how we can do this.ID| category| name| speciality 1 ABC Ram physics 2 XYZ Bhim Chemistry3 ZLN Zac Maths lis_Category table ABC 10 XYZ 20ZLN 30list_speciality physics 1A1Chemistry 2B2Maths 3C3Final output should be in the form ofID category name speciality 1 10 Ram 1A12 20 Bhim 2B23 30 Zac 3C3Pls help meThanks,Gangadhara MSSQL Developer and DBA |
|
ayadav0984
Starting Member
21 Posts |
Posted - 2011-06-13 : 06:27:54
|
try this out:assuming the lis_category table field names as : name, id2select a.id,b.id2,a.name,a.speciality into new_table from table1 a,lis_category b where a.name=b.name update new_table set speciality=c.speciality from new_table a,list_speciality cand a.speciality=c.speciality |
|
|
|
|
|