[dba-SQLServer] TRIGGER question

Arthur Fuller artful at rogers.com
Mon Jul 11 00:59:21 CDT 2005


Yes you're quite right, Michael. Should the update say "Update * FROM
Customers SET City = 'Los Angeles' WHERE City = 'New York'", then there
could be many rows in both #Inserted and #Deleted.

A.

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Michael
Maddison
Sent: July 10, 2005 9:21 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer] TRIGGER question

Not sure about the # myseld but I'd like to add that 'inserted' and
'deleted' can in some instances contain multiple rows.
If you think this affects you you could do something like...
Select Count(*) from inserted
or
@@ROWCOUNT may work as well.

cheers

Michael M





More information about the dba-SQLServer mailing list