Based only on what you described, you can do the following:INSERT INTO Test1(WoSun,WoMon,WoTue,WoWed,WoThu,WoFri,WoSat)SELECT MAX(CASE WHEN [Day] = 'Sunday' THEN 1 ELSE 0 END) AS WoSun, MAX(CASE WHEN [Day] = 'Sunday' THEN 1 ELSE 0 END) AS WoSun, -- and so on for the other 5 daysFROM Test
But I suspect there is more to it. Don't you have other columns in the table such as an ID or key that relate the two tables? If you do, you will need to join on those as well, or use PIVOT operator.If you can post more details, I am sure people on the forum would be able to offer more concrete suggestions. Take a look at Brett's blog for help in posting: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx