G
Guest
I have a BE I am converting to SQL Server. One of my routines links to an
Excel file and then takes the data from the excel file and inserts it into
one of my BE tables. The table I am inserting into has about 50 fields, most
of which are lookups to other tables. The Excel spreadsheet has user
friendly values supplied by the user. During the Insert, I must translate
the values given by the user in the spreadsheet into the appropriate IDs in
each of the supplemental tables.
I have done this both as a loop with .Addnew/.Update, and with a complicated
Append Query with lots of joins.
In the .mdb world, the Query worked OK, but I used the .Addnew/.Update
mechanism because I could show a progress bar on the screen and it was not
all that much slower than the query.
Now that I am going to SQL Server, the .Addnew/.Update loop is WAY too slow,
and the Query is not much better. I am thinking of converting it to a stored
procedure.
My question is, do I pass each excel record in turn to the SP (with each
field as a separate parameter)? Or is there a way to pass the entire
contents of the spreadsheet to the SP? In either case is there a limit to
the number of parameters that can be passed? Or to the type of parameters:
some are long comment fields?
Excel file and then takes the data from the excel file and inserts it into
one of my BE tables. The table I am inserting into has about 50 fields, most
of which are lookups to other tables. The Excel spreadsheet has user
friendly values supplied by the user. During the Insert, I must translate
the values given by the user in the spreadsheet into the appropriate IDs in
each of the supplemental tables.
I have done this both as a loop with .Addnew/.Update, and with a complicated
Append Query with lots of joins.
In the .mdb world, the Query worked OK, but I used the .Addnew/.Update
mechanism because I could show a progress bar on the screen and it was not
all that much slower than the query.
Now that I am going to SQL Server, the .Addnew/.Update loop is WAY too slow,
and the Query is not much better. I am thinking of converting it to a stored
procedure.
My question is, do I pass each excel record in turn to the SP (with each
field as a separate parameter)? Or is there a way to pass the entire
contents of the spreadsheet to the SP? In either case is there a limit to
the number of parameters that can be passed? Or to the type of parameters:
some are long comment fields?