"seems to have updated more rows in Organisation than there are rows in Import "What do you mean by SEEMS. Either it did, or it did not. --prepare tables and datadeclare @Org table (ORG_ID int, EMPLOYEE_BAND varchar(20))declare @Imp table (ORG_ID int, NO_OF_EMPLOYEES int, EMPLOYEE_BAND varchar(20))insert into @Org select 1234,'test foo 1' union all select 1235,'test foo 2'union all select 1236,'test foo 3'union all select 1237,'test foo 4'insert into @imp select 1234,3855,'10: 3001-5000'union all select 1235,15,'01: 1-20'union all select 1236,143,'04: 101-200'--update themUPDATE o SET o.EMPLOYEE_BAND = i.EMPLOYEE_BANDFROM @Org oINNER JOIN @imp iON o.ORG_ID = i.ORG_ID-- show resultsselect * from @orgRESULTS:ORG_ID EMPLOYEE_BAND------ -------------1234 10: 3001-50001235 01: 1-201236 04: 101-2001237 test foo 4
[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp