Is this what you are looking for?USE NorthwindGOCREATE TABLE myTable99 ([id] int, flag1 int, flag2 int)CREATE TABLE myTable00 ([id] int, status int)GOINSERT INTO myTable99([id])SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3INSERT INTO myTable00([id], status)SELECT 1,1 UNION ALL SELECT 2,2 UNION ALL SELECT 3,1 UNION ALL SELECT 3,2GOSELECT * FROM myTable00SELECT * FROM myTable99GOUPDATE a SET flag1 = status FROM myTable99 a JOIN myTable00 b ON a.[id] = b.[id] WHERE status = 1UPDATE a SET flag2 = status FROM myTable99 a JOIN myTable00 b ON a.[id] = b.[id] WHERE status = 2GOSELECT * FROM myTable00SELECT * FROM myTable99DROP TABLE myTable00, myTable99GO
Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam