Thursday, March 29, 2012

Excel Files against SQL Server - validation

Hi
I'm rather new to ASP.NET (was working with win forms before) and having a few problems with my first app.
To the point - this is an internal system - every week about 50 branches send financial reports to the headquaters where those excel files are validated against data in sql server. after file is uploaded to the server I'm opening it using Excel object model and iterating through it line by line. Apart from format and datatype checking, for each line there are ~2 stored procedures invoked
Everything is working actually but my concern is performance.. After about 800 rows it is getting really slow.. Appreciate any comments on this.
thanks
AMWhen the Excel files are that many you have two options use DTS package through a stored proc you either use DTSRUN.exe or XP_CMDSHELL which is SQL Server Agent dependent. Try the links below for DTSRUN.exe sample code and XP_CMDSHELL configurations with permissions. What I am saying is to run DTS with SQL Server Agent dependent service like xp_CMDSHELL you must give the account used to install SQL Server Agent Admin permissions in Windows and SQL Server. The solution with the XP_CMDSHELL can be scheduled to run for four hours a day five days a week. Hope this helps.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_8sdm.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_4jxo.asp

http://www.sqlteam.com/item.asp?ItemID=19595

No comments:

Post a Comment