Questions tagged as 'trigger'

2
answers

What is the best way to monitor a value in a database?

I'm working on an item management system, in which I need to constantly monitor the quantity of items available. Upon reaching a pre-set minimum threshold, the system should issue the item into an alert list for it to be reset. What would be...
asked by 12.07.2017 / 03:42
3
answers

In trigger we have INSERTED, DELETED, BUT and "UPDATED"?

Example scenario: I have the table / fields: documentos id documento pessoa item qtd valor The system gives INSERT and then UPDATE in this table in a contin...
asked by 28.08.2018 / 15:27
1
answer

Trigger for update before insert

My database has two tables, the notification and the service, as the image shows. Inthenotificationtablethedefaultstatusvalueis"open." I tried to do a trigger that updates the default status "open" to "on-call" after a new call is entered...
asked by 16.06.2017 / 22:03
1
answer

Sending data from one table to another with the deleted command

I'm creating this trigger in SQL Server , but I'm not getting the id to send the data to another table and delete this table. CREATE TRIGGER MoveComprador ON comprador INSTEAD OF DELETE AS BEGIN SELECT * INTO bk_comprador FROM...
asked by 19.06.2015 / 06:31
1
answer

Trigger without replicating data - SQL Server 2012

I have a trigger in the FRM_46 table that would be to replicate the data right after the insert or update for the FRM_31 table, however, it is not replicating, I already analyzed and did the tests, but I could not verify where the error is . A...
asked by 13.11.2017 / 19:28
2
answers

Trigger in MySQL VS logic in PHP application?

I am doing stock control system, and I would like to know the advantages and disadvantages between two ways of implementation to do the subtraction of the number in the stock after a sale / exit. 1) Do a% direct update in the application t...
asked by 08.09.2016 / 15:29
2
answers

SQLServer Trigger after update

Let's imagine the following scenario: CREATE TABLE invalido ( ds_valor character varying(255) ) CREATE TABLE email ( email character varying(255) ) I now need a trigger that every time I run a UPDATE or INSERT i...
asked by 30.11.2016 / 14:23
2
answers

PostgreSQL Trigger post update

Let's imagine the following scenario: CREATE TABLE invalido ( ds_valor character varying(255) ) CREATE TABLE email ( email character varying(255) ) I now need a trigger that every time I run a UPDATE or INSERT i...
asked by 08.11.2016 / 17:28
1
answer

Help with TRIGGER MYSQL [closed]

I need to mount a trigger that before deleting a user it checks if there are any events linked to the user in question, and if it exists, do not allow delete, but never worked with Triggers . Can anyone help me? I have the usuario...
asked by 05.12.2016 / 20:04
1
answer

Implement Triggers in Postgre

Can you implement a trigger to work in a column that is present in all database tables?     
asked by 28.10.2017 / 19:50