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 |
filthy
Starting Member
1 Post |
Posted - 2006-10-23 : 11:03:47
|
Hi. New job, new to sql server, first task. Here goes:source table: EMP (empId, name, hairColor, skinColor, birthCity)I need to select date from EMP and insert into these tables:HAIR_COLOR (hairColorId, colorName) id populated by sequenceSKIN_COLOR (skinColorId, colorName) id populated by sequenceBIRTH_CITY (birthCityId, cityName) id popluated by sequenceGO back and update a couple of columns in the EMP table (referential integrity). Total record count should be around 100,000.How can i go about this? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-23 : 11:19:13
|
[code]insert into HAIR_COLOR(ColorName)select distinct hairColorfrom EMPinsert into SKIN_COLOR(ColorName)select distinct skinColorfrom EMPinsert into BIRTH_CITY(cityName)select distinct birthCityfrom EMP[/code] KH |
|
|
|
|
|