i want to delete row in excel file from query because when i insert data in 2nd time, data is not insert in proper place for example
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\TestDB\first.xls;', 'SELECT cid, ClassName FROM [Sheet1$]') SELECT cid, classname FROM Class GO
now rows insert from top row, it's fine. now i want to execute this again. i want to delete old data and insert new data. for this purpose i use this query
updateopenrowset('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\TestDB\first.xls;','SELECT cid, ClassName FROM [Sheet1$]')set cid=null, classname=nullINSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\TestDB\first.xls;', 'SELECT cid, ClassName FROM [Sheet1$]') SELECT cid, classname FROM Class GO
Now insert from 60 row not in top row. I want to insert again in top row
please help thanks