[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Trigger fires with inserted/deleted tables empty

Posted on 2005-04-29
Medium Priority
Last Modified: 2008-02-26

What does it mean when a trigger fire when @@rowcount = 0, and both the inserted and deleted tables are empty?


Question by:jkavx
  • 2
LVL 29

Expert Comment

ID: 13897471
@@rowcount = 0 means no rows were returned.  In your case it may mean nothing was inserted or delete.  How and where did you get this message?

Author Comment

ID: 13897787

I'm testing at the start of a trigger for @@rowcount.  This is a trigger on insert/update/delete.

So if I update a table and no transactions occur (Update Project set name = 'x' where 1=2), the trigger will still fire and @@rowcount will be 0?
LVL 29

Accepted Solution

leonstryker earned 750 total points
ID: 13897890
Sounds right an event happened, but no data was actually affected.  Therefore @@rowcount = 0 and there are no records in the inserted and deleted tables.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question