Jump to content
  • 0

Table trigger to simultaneously count new value and table values



3 answers to this question

Recommended Posts

  • 0

What you can do is use this task trigger config as a template if you want to combine the old table data plus the newly inserted data.

With this, you can different sorts of operations and to manipulate values (pre-insert values and post-insert value) using a trigger upon insert.

Link to comment
Share on other sites

  • 0

First question is, how are you counting the records. Do you have a parent table where the counter is going to be saved?

The reason why the inserted record is not being counted, because if you do the Select count on the trigger - the trigger will be counting the records that are currently inside the table. 

So when it comes to counting or summing the values, you need to include the #inserted value. Or in this case, you can just simply add 1 to the Select Count query. 


Hope this helps. 



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...