RecheckRows database parameter
Description
Rechecks the number of rows affected by an INSERT, UPDATE,
or DELETE command and returns it in the SQLNRows property of the Transaction
object.
Controls
-
ADO.NET
-
OLE DB
-
SNC SQL Native Client for Microsoft SQL Server
Syntax
|
1 |
RecheckRows=<span>value</span> |
|
Parameter |
Description |
|---|---|
|
value |
Specifies whether the value of the Microsoft SQL Server @@rowcount
|
Default
RecheckRows=0
Usage
In Microsoft SQL server,
if a table has an insert, update, or delete trigger, the number
of affected rows returned to the SQLNRows property
of the Transaction object after an INSERT, UPDATE,
or DELETE command depends on the driver. With
an ADO.NET driver, the value returned is the sum of the rows affected
by the command itself and the trigger.
When you are connected to Microsoft SQL Server
using ADO.NET or OLE DB, you can set the RecheckRows runtime database
parameter to 1 to recheck how many rows of data were affected by
the INSERT, UPDATE, or DELETE command
itself and return that value in the SQLNRows property.
Setting RecheckRows to 1 before issuing an INSERT, UPDATE,
or DELETE command causes a SELECT @@ROWCOUNT command
to be executed. To improve performance, you should set it only when
required, and reset it to the default value of 0 after use.
Examples
To set RecheckRows to 1, type the following in code:
|
1 |
SQLCA.DbParameter="RecheckRows=1" |