Multi-part Exce Import to Sql Server

Joined
Feb 20, 2008
Messages
2
Reaction score
0
Hi everyone, I have found alot of help from this site as I have just started my career. I am unable to find help on one specific topic anywhere though. I have an asp.net site that lets the user upload a file to the server and then the excel data is selected and sent to sql server and triggers a stored procedure which uses the data toproduce a new excel file for the user. However the files coming back are too large, so I need to find a way to split the return into multiple files using 200 records at a time from the import. I have no idea where to begin on this, any ideas would be appreciated.

Thanks,
Allen
 
Joined
Feb 20, 2008
Messages
2
Reaction score
0
Maybe I can make the question more clear, I realize it's a bit spastic in my first post. Currently I have my asp.net page that has the user upload the excel file to the server. Then I use the following code to directly insert it into the Sql Server table:

Dim excelConnection = New OleDbConnection( _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Inetpub\wwwroot\allen-test\incoming\" & c & ";" & _ "Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;""")

excelConnection.Open()

Dim excelCommand As New System.Data.oledb.OleDbCommand("INSERT INTO [ODBC; Driver={SQL Server};Server=xxxDB01;Database=xxDCC;UID=xxxxx;PWD=xxxxx].[tblGMTagPrint]SELECT [item id], [common code] FROM [sheet1$];", excelConnection)

This inserts the entire file into the table. From there I trigger stored procedures to get the output I need.

What I need to do now though is send the records to the table for processing 200 rows at a time. Hopefully that will be clearer and somebody can give me an idea of where to start.

Thanks,

Allen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top