472,993 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

insert command sql server 2005


I do this - take some data with sqldataadaptor (at this moment
2000rows) in fill datatable.

For each two rows do some calculations and save data to the database
with insert command.
(the data which I insert are 5 int values for each two rows - so
2000*1999 insert commands)
In this way it is very slow. I think this is because of the invoking so
many times of the insert command (because without insert command it
takes about 10 min, but with it may be it will work 1-2 days (I run the
program in debug mode)).

Do you know other ways to do this (faster)?
(may be with sqldataadaptor).


Nov 3 '06 #1
1 3615
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.

Nov 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: hartley_aaron | last post by:
Hi, I have an application running on a wireless device and being wireless I want it to use bandwidth as efficiently as possible. Therefore, I want the SQL statement that it uploads to the SQL...
by: rhaazy | last post by:
Using ms sql 2000 I have 2 tables. I have a table which has information regarding a computer scan. Each record in this table has a column called MAC which is the unique ID for each Scan. The...
by: Ted | last post by:
I have BULK INSERT T-SQL statements that work for all of my basic data tables except for one. Here is the problem statement (with obvious replacement of irrelevant path info): BULK INSERT...
by: Dot Net Daddy | last post by:
Hello, I cannot get the following Insert Command work. I get the error: Error converting data type varchar to numeric. Description: An unhandled exception occurred during the execution of...
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
by: NickW | last post by:
I have written a stored procedure that is used to load data into a SQL Server 2000 and 2005 databases from some 40ish different text files. One of the text files is loading all of the rows apart from...
by: junkmail115 | last post by:
Greetings, A novice needs some advice: I am able to bulk insert data from a text file into a table. Is it possible to run a query and insert the results into a text file on the local or...
by: sangam56 | last post by:
Greetings. I suppose people out there can help in my problem. I am using sql server of microsoft visual studio 2005 itself. I have created a stored procedure which is give below. It works fine but...
by: Andrevv | last post by:
Hi all! Im totaly new in programing, so i need some help if someone can help me... Im programing in VS 2005, C# language and using MS SQL Server 2005 . So, after i fill my table with 10 records,...
by: anu b | last post by:
Hi I need to use Clr trigger for insert command My code is as below I am using SQL server 2005 and VS 2008.... but after running this code i didnt get the result as i expexted it shows the...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.