473,566 Members | 3,245 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 5117
Have you actually tried this and verified that it works?

On Wed, 21 Apr 2004 17:10:52 -0400, "KA" <ab***@aol.co m> 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.co m> 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.co m> 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

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 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...
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
1420
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 would like to get a compile time warning when this method is called. That way a programmer using this library sees the warning and can change...
1
3406
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 UpdateBatch the application (VB6) disappears - it just stops and vanishes. can anyone suggest a way for solve my problem? Thanks. ...
0
1725
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: metadata operation warning (00131189) : Inconsistent parameter information in duplicated methods (methods: new; type: <Module>): (0x08000005).
0
1041
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 UpdateBatch(ByVal DTable As DataTable) Dim mSqlDa As SqlDataAdapter Dim MustCloseConnection As Boolean
5
5079
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 is as follows Warning CA2122 : Microsoft.Security : MyClass.Method():Void calls into Marshal.GetExceptionPointers():IntPtr which has a LinkDemand....
1
3583
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 resides on a network drive while the front end is on my C: drive. My code is as follows: Dim rstBalances As New ADODB.Recordset Dim strSQL As...
2
1108
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 line--------------------------------------- FILETYPE(0) = Lcase(FILETYPE(0).Concat(".", FILETYPE(0))) --------------------------------------------------
0
7584
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...
0
7893
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
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...
0
7953
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6263
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...
1
5485
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
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...

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.