473,466 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SQL tuneing

90 New Member
How could I increase the performance of sql server 2000.
For example if write a query for update as
Expand|Select|Wrap|Line Numbers
  1. update tablename set column1=newcols1,column2=newcols2,column3=newcols 3 where keyvalue=somevalue
  2.  
This would work,but if the user only updates only one Column for example column2 what is the use of sending other columns to update.
I do not want a query like updating every column in different query only one query that does my work perfectly.ie taking only the columns which has been updated and update that in the table.

Thanks in advance
Raghul
Sep 19 '08 #1
3 1061
Delerna
1,134 Recognized Expert Top Contributor
you would need to use parameters and if statements to make the decision of which fields to update based on the parameters passed.
The overhead of making those decisions would probably negate any performance increase.

or

In the front end you could update each field as it changes via a change event.
But then, if you actually need to change more than one field then that would result in multiple update calls which would mean another loss in performance.

or

you could make the decision of which fields need updating in the front end and build the update query there. But again I wonder how much you will actually save.

If you are only updating 1 record then reducing the number of fields to update would only result in a miniscule increase in performance anyway. You could even make performance worse. You need to consider this carefully. Is the performance gain (if any) worth the cost of implementation?

Run some performance tests on any ideas you try.
Sep 19 '08 #2
Delerna
1,134 Recognized Expert Top Contributor
Has anyone done, or know of, any tests to measure the differnce between updating 1 Field of a record as opposed to updating all the fields of that record?

My guess is that it would be insignificant, but I could be wrong.
If you had a few large varchar fields, things might change.

If you were doing a mass update on many records the difference becomes significant, but in my experience, those tasks tend to be a 'one off' that you write a query for that specific task and then throw it away.
Sep 21 '08 #3
ck9663
2,878 Recognized Expert Specialist
Imagine, if you have 70 columns and you have a trigger on UPDATE, and you updated one column at a time. If not properly designed, that TRIGGER will fire 70x. Not to mention if any of those columns have CONSTRAINTS and REFERENTIAL INTEGRITY implementations.

-- CK
Sep 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: JH Higgins | last post by:
I have an Access 2000 database I use together with one other person. As I try to append new records to a table using a standard jet SQL INSERT INTO statement I get error 3197, another user is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.