So each crossed combination (except to self) needs a row? In this scenario,
I would probably find a way of saving the 2000 rows into a staging table on
the sql-server (2000 inserts), and then running an SP (or other SQL command)
that does the cross join and calculations locally to save round trips. Of
course, first I would verify the need for the cross-join at all, as this is
(obviously) not linearly scalable.
Another option (for more complex calculations) would be to do the cross-join
in the C# (as now), but write the data as csv / tsv to a text file, then
bulk insert the text file. Less round trips, but still transfers more data
over the network.
Marc |