Rows Affected

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Bill Gage
Posts: 18
Joined: Fri 14 Oct 2005 17:23

Rows Affected

Post by Bill Gage » Wed 20 Dec 2006 18:39

I noticed in SQL Server's query analizer that it returns the number of rows affected when running an Update statement. Is that possible with the SDAC components? If so, how do I do it? It would save me the extra effort of having to do a count query after an update.

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Thu 21 Dec 2006 16:15

Use the TCustomDADataSet.RowsAffected property to determine how many rows were updated or deleted during the last query operation. If RowsAffected is -1, the query did not update or delete any rows.

Bill Gage
Posts: 18
Joined: Fri 14 Oct 2005 17:23

Rows Affected

Post by Bill Gage » Thu 21 Dec 2006 19:16

Thank you so much I can kiss your feet! :D

matej
Posts: 5
Joined: Mon 08 Nov 2004 21:01

Post by matej » Thu 22 Mar 2007 16:57

How can I get info about Affected rows when I execute multiple statements in one TMSQuery.execute? In RowsAffected I get info just about "last" statement.

Thanks for info.

Matej

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Fri 30 Mar 2007 13:47

SDAC doesn't support such functionality.
You can see the number of affected rows only for the last statement in the batch.

Post Reply