Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Update Sql Server From Open Sheet

Author  Topic 

khateeb82
Starting Member

4 Posts

Posted - 2008-02-01 : 17:54:06
hi all
any body help me for my problem in my code
i need to update my sql from excel sheet. but my excel sheet must be open all time, coz it connected with server to update value into this excel sheet.

and i put this code in calc event into this excel sheet:

SqlCom.CommandText = "Update DirectMarket Set DirectMarket.StockVolume=T2.Volume, from DirectMarket inner join (Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\test.xls;HDR=YES','SELECT * FROM [Sheet1$]')) T2 On DirectMarket.StockSymbol = t2.Symbol "

but this code ask me to close excel sheet to complete update data into SQL server.
i cant close file cose it updated all time.

so please i want to know how can i do update data while excel file is open ????

thank u so much for all.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-02-01 : 18:29:07
DTS?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

khateeb82
Starting Member

4 Posts

Posted - 2008-02-02 : 12:08:23
DTS need to close excel when i transfer data to sql .
i cant close my excel coz it update all the time.
Go to Top of Page
   

- Advertisement -