BUG: @@ROWCOUNT May Be Misreported Inside a TriggerID: Q188031
|
When joining two tables for a condition during an update of a table inside
a trigger, the @@ROWCOUNT global variable may return the number of joins,
rather than the number of affected rows.
This behavior only occurs if the @@ROWCOUNT global variable is checked
within the Transact-SQL code of a trigger. If it is checked outside of a
trigger, @@ROWCOUNT behaves as expected.
To work around this problem, check count(*) on the inserted table, rather than @@ROWCOUNT within the trigger Transact-SQL code.
Microsoft has confirmed this to be a problem in SQL Server and SQL Server Enterprise Edition version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Additional query words: EE SQLEE TSQL T-SQL tran-sql trans-sql tran trans
Keywords : SSrvTran_SQL kbbug6.50
Version : WINNT:6.5
Platform : winnt
Issue type : kbbug
Last Reviewed: April 19, 1999