Questions tagged as 'trigger'

1
answer

C # Does not execute stored procedure + trigger

Friends how are you! I have a stored procedure that inserts records in a table, which I run from a WinForms application, I was making some modifications and I added a Trigger to the table to which the procedure inserts the data. But alread...
asked by 14.06.2018 / 16:22
2
answers

How to create a delete trigger in SQL Server2012?

I have a table called Productos in which I want to create a trigger which does not allow to delete a record when the existence of this product is greater than 0 I tried the following: go create trigger ProductoExistencia on...
asked by 01.12.2016 / 19:27
1
answer

Update records using a TRIGGER FOR DELETE using SQL Server

I want to make a trigger that as soon as I make a dismissal to the rest of the employees I raise the salary by 20%, but I do not know how to operate directly with the cursor explícito in this trigger , since the query would g...
asked by 14.02.2017 / 23:03
3
answers

How to create a trigger in mysql that when deleting a row from a table, I deleted a database?

I have a table in mysql of name Contracts who has the sig. structure: ---------------------- |id|nombre |fecha | ---------------------- |1 |Emp1 |2015-02-12| ----------------------- |2 |Emp2 |2016-02-11| -----------------------...
asked by 14.07.2016 / 00:19
1
answer

Trigger to subtract dates

Hello colleagues I have this query that works well to find the difference between two dates in days, hours, minutes and seconds but when I pass it to the trigger it does not work anymore I get a number 4873 I do not know what I'm doing wrong, my...
asked by 05.07.2017 / 16:20
2
answers

Sum of times sql server

I want to do a triggers query in SQL Server for the following: A calculated field my column subtracts is the difference between two dates and I want the total column to make me the sum of those differences plus the difference of the previous...
asked by 05.07.2017 / 18:47
2
answers

Create .click triggers inside a for loop

I have the following code: $(document).ready(function(){ console.log($("body").find("form label input")); //da un objeto, una lista, con los diferentes inputs dentro del label dentro del form for (var i = 0; i < $("body").find("form l...
asked by 28.04.2017 / 00:46
2
answers

Error creating Trigger in Postgresql - syntax error at or near "BEGIN"

I am currently trying to create a trigger in postgresql to perform an insert in a table. But when executing the sentence the result throws:    ERROR: syntax error at or near "BEGIN"   LINE 4: BEGIN CREATE TRIGGER TRG_INS_DOCUMETTYPE...
asked by 21.11.2016 / 19:46
1
answer

Error creating a Trigger

I'm trying to create the following trigger: DELIMITER // CREATE TRIGGER 'smdraux_after_insert' AFTER INSERT ON 'smdraux' FOR EACH ROW BEGIN IF(LENGTH(NEW.llamante) = (4) AND NEW.nombreinterlocutor1 NOT LIKE 'VM Channel%' AND NEW.nombreint...
asked by 02.01.2019 / 17:58
1
answer

Trigger Remove after 24 hrs

This is the way to perform a trigger that removes data from my database that is less than 24 hours. I have the following table of reservations and in this I add a field 'Type' that can be permanent or by hours, if it is by hours it will be el...
asked by 07.11.2018 / 18:40