Update Excel sheet cells by using DTS package | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Update Excel sheet cells by using DTS package

——————————————————————————– Hi I have a table called tblemployeeinfo containing 5 columns in sql server. I have to compare this columns with excel sheet data, if there is any change in the data between the excel and the table, i need to update or delete the data from the excel sheet. How to achieve this using DTS package? Help please.

First of all from this excel sheet import data to a temporary table,
Then compare this temp table to your table ‘tblemployeeinfo’ . and if there is a change update other wise dont update. you can use following update statement as reference UPDATE titles
SET ytd_sales = titles.ytd_sales + sales.qty
FROM titles, sales
WHERE titles.title_id = sales.title_id
AND sales.ord_date = (SELECT MAX(sales.ord_date) FROM sales)
using where clause you can compare all 5 columns if they are different or not .

]]>