473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

warning re ADO .UpdateBatch method

Awhile back there was some discussion about ways of sending multiple
rows of data to SQL Server. The ADO .UpdateBatch method was one of
the possibilities mentioned, and Erland said he thought that probably
once the data get to SQL Server they are probably actually inserted
one row at a time. I just want to say that based on an experience I
had a couple of days ago I am now sure that is the case. I was using
..UpdateBatch for something quick and dirty I had to do just once and
was too lazy to use XML for. An error was generated during the
..UpdateBatch process because of invalid data in one row. However, a
large number of the rows in the batch WERE written to the database.

Until now I haven't used .UpdateBatch in a production environment only
because this implies granting INSERT or UPDATE privileges to the user.
But based on this experience I would NEVER use .UpdateBatch in a
production environment, even for a user like a batch job where the
permissions would not be an issue.

FWIW.
Jul 20 '05 #1
11 5111
Have you actually tried this and verified that it works?

On Wed, 21 Apr 2004 17:10:52 -0400, "KA" <ab***@aol.com> wrote:
Do it in a transaction...


Jul 20 '05 #2
KA
This is the whole purpose of transactions. You commit/roll back all changes
that was done in the transaction.
Jul 20 '05 #3
KA
Here's a good starting place:
http://msdn.microsoft.com/library/en...md_06_2it2.asp
Jul 20 '05 #4
KA
Do it in a transaction...
Jul 20 '05 #5
Why do you assume I don't know what a transaction is? My question is
whether the ADO .UpdateBatch method respects that.

On Thu, 22 Apr 2004 16:27:45 -0400, "KA" <ab***@aol.com> wrote:
This is the whole purpose of transactions. You commit/roll back all changes
that was done in the transaction.


Jul 20 '05 #6
KA
Of course it does.

UpdateBatch will use whatever connection is associated with the RS and will
simply translate your changes into a bunch of insert, update and delete
statements wrapped by sp_executesql.

If you are in a transaction, your UpdateBatch calls will be part of that
transaction.
Jul 20 '05 #7
Have you actually tried this and verified that it works?

On Wed, 21 Apr 2004 17:10:52 -0400, "KA" <ab***@aol.com> wrote:
Do it in a transaction...


Jul 20 '05 #8
KA
This is the whole purpose of transactions. You commit/roll back all changes
that was done in the transaction.
Jul 20 '05 #9
KA
Here's a good starting place:
http://msdn.microsoft.com/library/en...md_06_2it2.asp
Jul 20 '05 #10
Why do you assume I don't know what a transaction is? My question is
whether the ADO .UpdateBatch method respects that.

On Thu, 22 Apr 2004 16:27:45 -0400, "KA" <ab***@aol.com> wrote:
This is the whole purpose of transactions. You commit/roll back all changes
that was done in the transaction.


Jul 20 '05 #11
KA
Of course it does.

UpdateBatch will use whatever connection is associated with the RS and will
simply translate your changes into a bunch of insert, update and delete
statements wrapped by sp_executesql.

If you are in a transaction, your UpdateBatch calls will be part of that
transaction.
Jul 20 '05 #12

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

Similar topics

1
469
by: Ellen K. | last post by:
Awhile back there was some discussion about ways of sending multiple rows of data to SQL Server. The ADO .UpdateBatch method was one of the possibilities mentioned, and Erland said he thought...
0
357
by: Giovanni pepe | last post by:
I have then necessity of utilize old UpdateBatch of vb6 in VB DotNet.. I have View as in net it must be used Command Builder, Where I can find some example... Thank you
3
1413
by: Capstar | last post by:
Hi NG, I have a library of which I want to change the name of a specific method so it is more intuitive. I plan to keep the old method in there for now so I won't break any existing code. But I...
1
3402
by: Vascelli Germano | last post by:
I'm currently experiencing a problem using ADO 2.7 with DB2 7 (DB2 UDB FOR OS/390 V7). I use ODBC like datasource. After populating a disconnected recordset, reconnecting it, and doing a...
0
1712
by: Peter | last post by:
Hi, I've been recently porting some software written under VC++ 6.0 to VC .NET. The software was compiling fine under 6.0 but under .NET I'm getting linker warning: b.obj : warning LNK4227:...
0
1037
by: Giovanni pepe | last post by:
This is my error : <<impossible to approach the information on the line eliminated through the line>> This is my code for updateBatch : Private mSqlConn as sqlConnection Public Function...
5
5073
by: Peter Ritchie [C# MVP] | last post by:
I've purposely been ignoring a CA2122 warning in some C++ interop code I've been working on for quite some time. I've just recently had the cycles to investigate the warning. The warning message...
1
3579
patjones
by: patjones | last post by:
Hi: I am attempting to pull a backend table into a local recordset, make some changes to it, and commit the changes back to the table. I'm using an ADO recordset in Access 2007. The backend...
2
1101
by: Brian | last post by:
Hi, No matter how i do this, I get the same warning. I don't understand the warning.... Dim FILETYPE as string() = {"tree;.tree;*.tree"} for x as integer = 0 to ubound(FILETYPE) Orginal...
0
7126
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
7005
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...
0
7381
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
5465
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,...
1
4916
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...
0
4595
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
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
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 ...
0
293
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...

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.