473,657 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

insert command sql server 2005

Hi,

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) .

Thanks.

Nov 3 '06 #1
1 3643
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
Nov 3 '06 #2

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

Similar topics

2
2260
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 Server to be as efficient as possible. In one instance, I give it four records to upload, which currently I have as four seperate SQL statements seperated by a ";". However, all the INSERT INTO... information is the same each time, the only that...
3
1822
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 table in question holds the various scan results of every scan from different computers. I have an insert statement that works however I am having troulbe getting and update statement out of it, not sure if I'm using the correct method to insert...
2
14650
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 igbconts_tmp FROM 'C:\\my_code_path\\IGBCONTS.txt' WITH (KEEPNULLS, FORMATFILE = 'C:\\my_data_path\\contacts.fmt');
2
6208
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 the current web request. Please review the stack trace for more information about the error and where it originated in the code.
1
6125
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 label,textboxs,dropdownlists,radiobutton and checkbox asp standard controls. On the click event of the command button the data gets stored into the database. I have created the stored procedures for the insert,update,delete. I have...
0
2599
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 the last one. No error message is issued when this happens. The command I am using to load the data is as follows: BULK INSERT BasicDataT FROM 'E:\Temp\Food GNRLv3\BasicData.txt' WITH ( FORMATFILE =...
2
12960
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 network hard drive? Thanks For Reading, Aaron
2
2225
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 it always inserts two records into the database. All columns of the two rows are same but the primary key is different which is no surprise. Please help me get out of this problem. -------------------------------- code goes here...
4
3742
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, i would like to use First In First Out ordering process. The problem is, that after the DELETE statement, when i trigger the INSERT statement, the record is not placed in the last row, but replaces the row that i've deleted... I have 2...
7
5787
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 result as no row is effected ...Please help me guys using System;
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.