Page 1 of 1

Rows Affected problem

Posted: Mon 23 Dec 2013 17:03
by atome
Hello,
I have a problem with Rows Affected property.
With TMSSQL component the value of RowsAffected property depends from table trigger on update and delete commands. While ApplyUpdates of TMSQuery fails on delete command.
The property DMLRefresh of TMSQuery is active and insert/update commands work.
How to use TMSSQL without modify trigger to reflect rows affected not considering trigger rows?
Why TMSQuery has a different behavior?

SDAC version: 6.7.13 in Delphi XE4.
Thanks.

Alessandro

Re: Rows Affected problem

Posted: Wed 25 Dec 2013 07:22
by AndreyZ
Hello,

You can avoid this problem by adding the "SET NOCOUNT ON" line to the code of your triggers.

Re: Rows Affected problem

Posted: Fri 27 Dec 2013 10:20
by atome
Hello,
I can't modify triggers because they are not under my control.
With old version of SDAC the returned number of rows affected was correct.
Can you suggest a way to modify your component code to mantain old behavior?

Thanks.

Re: Rows Affected problem

Posted: Fri 27 Dec 2013 15:41
by AndreyZ
Please try creating a small sample that demonstrates the problem and send it to support*devart*com , including a script to create all needed server objects (tables, triggers, etc.).
Also, please specify the exact version of your SQL Server server and client. You can learn it from the Info sheet of TMSConnection Editor.

Re: Rows Affected problem

Posted: Fri 03 Jan 2014 16:20
by atome
Hello,
I have sent to [email protected] a small example project. Please, see email.

Thank you.

Re: Rows Affected problem

Posted: Wed 08 Jan 2014 14:21
by Dimon
The point is that TMSQuery returns a correct result - count of updated rows, and TMSSQL returns count of rows in the resultset returned by the trigger.
This behaviour depends on the SQL Server specificity, and we can't influence it.

With old version of SDAC the returned number of rows affected was correct.
Please specify the exact SDAC version, where this behaviour was different from the current one.