Re: What to use for ADO parameter type and size
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Fri, 27 Jul 2007 16:51:43 +0100
On all of this
(i) What database are you using?
(ii) What is the SQL command?
It maybe that SQL command could be optimised.
I endorse the parameterised query approach.
It really depends on how many you are going to execute.
If it is only a few, a Connection Execute is better (because of the extra
effort in setting up a Command object)
At some point, the initial overhead of setting up a Command object +
database is no longer reworking every time making a query plan starts to
overtake the simple approach.
I would interesting to find out what the crossover point is: 5? 15? 100?
At the moment in my own code, from about 6 years ago, I use RecordSets and
UpdateBatch to Insert records on SQL Server 2000 tables. This is because I
never found a faster approach.
Command objects were not faster. And BULK INSERT only works if the Server
has access to the drives where the text file is located.
But a remark by Bill Vaughn made me realise that Nagles Algorithm comes into
play and the slow down is the round trips to the Server in terms of network
packets.
It works out that you can send multiple INSERTs. So I will investigate this
at some point. Some rainy day.
Cheers
Stephen Howe
.
- Follow-Ups:
- Re: What to use for ADO parameter type and size
- From: RB Smissaert
- Re: What to use for ADO parameter type and size
- References:
- What to use for ADO parameter type and size
- From: RB Smissaert
- Re: What to use for ADO parameter type and size
- From: Bob Barrows [MVP]
- Re: What to use for ADO parameter type and size
- From: RB Smissaert
- Re: What to use for ADO parameter type and size
- From: Bob Barrows [MVP]
- Re: What to use for ADO parameter type and size
- From: RB Smissaert
- What to use for ADO parameter type and size
- Prev by Date: Re: What to use for ADO parameter type and size
- Next by Date: Re: What to use for ADO parameter type and size
- Previous by thread: Re: What to use for ADO parameter type and size
- Next by thread: Re: What to use for ADO parameter type and size
- Index(es):
Relevant Pages
|
|