Import the csv file using Import/Export wizard into a table. Import/Export wizard can be invoked from SSMS object explorer, right-click the database name and Tasks -> Import data.Once you have the database table, use unpivot like shown below; this is only a demo - you will need to adapt it to your data. If you post sample data in consumable format, usually people on the forum will post exact solutions. See here if you need help in generating consumable DDL and sample data http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx CREATE TABLE #tmp(id INT ,col2 INT,col3 INT ,col4 INT )INSERT INTO #tmp VALUES (1,0,1,0),(2,1,0,0),(3,0,0,1),(4,0,1,0);SELECT id, DateCol, DataValueFROM #tmpUNPIVOT (DataValue FOR DateCol IN ([Col2],[Col3],[Col4]))U-- WHERE Datavalue = 1DROP TABLE #tmp;