Questions tagged as 'trigger'

3
answers

List all triggers in SQL Server

Is there a command that lists all triggers of a database in SQL Server?     
asked by 01.09.2016 / 20:11
1
answer

Updating application (C #) in real time with the Database (Mysql)

I'm creating a client server application, the application would run on multiple machines using the same database (mysql) on an online server. I would like as soon as the data in a table were changed, inserted or even deleted, the other applic...
asked by 20.05.2017 / 07:31
4
answers

How to do a "Generic Trigger" in SQL Server?

Hello, I have in my database in all tables the following fields DateTime CreatedEm | Modified DateTime I wanted to know if there is a way to do a generic trigger to control these fields, since when you enter, CriadoEm and Modif...
asked by 18.03.2014 / 17:28
2
answers

How to create a trigger in MySQL?

I have tables usuarios , usuario_voto , and classificacao_usuario . Usuarios: system user table. usuario_voto: table that stores vote from one user to another. classificacao_usuario: table that sto...
asked by 22.04.2015 / 08:34
1
answer

What is the difference between the MySQL Trigger exception and MySQL Event?

I would like to create an Email trigger scheduler , if possible, without using cron , and would like to know if you can do this through MySQL >. Searching the Internet I've seen some examples of creating a non-cron event : CREATE...
asked by 14.12.2015 / 13:38
2
answers

How do I create a trigger that fires whenever I have an insert event in the table?

I need to create a trigger that fires whenever I have an insert event in the table, before it is inserted, it checks a condition, if the condition is respected it changes the value of a certain field that is being inserted. Example: -- id...
asked by 04.04.2014 / 15:53
1
answer

Can a trigger "undo / undo" the triggering action?

Example scenario I have a telefones table where I have a trigger statement that is triggered when executing the insert statement. Doubt Can I use the trigger to check a condition and upon return, "cancel" the actio...
asked by 06.09.2018 / 01:42
1
answer

Is there a parameter passing in a trigger?

I have two tables, one with the sessions and another with the activities. Within the activities table I have two fields, available and salable and within session I have vacancies. I would like to get the id of the session to be able to do the...
asked by 23.07.2015 / 20:33
1
answer

Can I invoke the function in a Trigger?

My function made in Sql-Server: CREATE FUNCTION dbo.getQuantidade(@idProd char) RETURNS float AS BEGIN DECLARE @QTD float SET @QTD = (SELECT (prod.Quantidade) FROM Produto prod where @id_prod = IdProduto) return @Q...
asked by 29.06.2016 / 16:58
1
answer

How can I prevent the deletion of relational data through referential integrity in MYSQL?

I have the SIMULATE and QUESTION tables, where a simulation can have several questions, but one question can only be for a simulated (1-n relationship). SIMULATED TABLE: simuladoId simuladoNome QUESTION TABLE questaoId questaoPergu...
asked by 14.09.2016 / 17:37