A data adapter does not do a round trip for every changed row. It batches
them together and fires them down with 1 big sp_execute.
Now for every datadapter update there would be a round trip. In my master
detail updates this is 4 (1 child deletes, 1 parent.Update() ins/upd/del, 1
child inserts, 1 child deletes).

I thought diffgram support required a special dll on the client. Wouldn't
this mean that the driver/dll is then breaking this all down into multiple
updates/inserts/updates and then sending them to the server? I guess my
question is diffgram support really built into the sql server kernel? And if
so do you only get one trigger per table action firing or is there some
looping done by the sql kernel?

Barry Gervin
www.ObjectSharp.com/Barry

----- Original Message -----
From: "Shawn Wildermuth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 2:38 PM
Subject: Re: [DOTNET] ADO.NET multiple table updates


> Sending a diffgram seems like it would be much cheaper than actually
> doing a round trip for every changed row, no?
>
> Thanks,
>
> Shawn Wildermuth
> [EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: dotnet discussion [mailto:[EMAIL PROTECTED]]
> > On Behalf Of Chris Anderson
> > Sent: Thursday, May 16, 2002 10:53 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [DOTNET] ADO.NET multiple table updates
> >
> >
> > Thanks
> >
> > I am using three adapters, and an updating the parent first
> > (I have to update the parent first, to ensure integrity on
> > the database, and for new records, the foreign key(FK) isn't
> > known until the parent table has been written)
> >
> > The child tables do get updated with the FK once I call
> > Update on the parent table's adapter, but they are
> > immediately flagged as updated, so when it comes to using
> > their respective adapters to do their updates...nothing
> > occurs (the DataTable thinks it has already been updated)
> >
> > It occurs because I have the FKConstraints setup in the DataSet, ie
> >             Dim fk As ForeignKeyConstraint
> >             fk = New ForeignKeyConstraint("TypesFK",
> > dtSession.Columns("sessionid"), _
> >                                 dtTypes.Columns("sessionid"))
> >             fk.UpdateRule = Rule.Cascade
> >             fk.AcceptRejectRule = AcceptRejectRule.Cascade
> >             dtInstitutionTypes.Constraints.Add(fk)
> >             fk = Nothing
> >
> > If I remove them just before the parent table update, the
> > child tables are not flagged as written..but then they also
> > lose the automatic FK update when the parent table's ID is
> > set at the database
> >
> > I'm using SQL Server 2k, yes
> > I was thinking about using the GetXML, and passing that, then
> > using SQLXML to parse it server-side, but the diffgram could
> > potentially be large, so passing it via a SP parameter may
> > cause problems (Unless you are thinking of a different idea there)
> >
> > Merak
> >
> > > -----Original Message-----
> > > From: Shawn Wildermuth [mailto:[EMAIL PROTECTED]]
> > > Sent: 16 May 2002 15:21
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: [DOTNET] ADO.NET multiple table updates
> > >
> > >
> > > I have found that a separate DataAdapter for each table is
> > necessary
> > > and calling them in the right order is crucial in many
> > instances.  It
> > > matters how your schema in the database (not the DataSet)
> > is expecting
> > > the data as to how you would call the updates.  Are you
> > using one or
> > > three data adapters? If you are using SQL Server (2k?), maybe
> > > diffgrams are the better way to go if you can use SQLXML 3.0.
> > >
> > > Have I muddied the waters or clarified them?
> > >
> > > Thanks,
> > >
> > > Shawn Wildermuth
> > > [EMAIL PROTECTED]
> >
> > You can read messages from the DOTNET archive, unsubscribe
> > from DOTNET, or subscribe to other DevelopMentor lists at
> > http://discuss.develop.com.
> >
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to