Questions tagged as 'trigger'

1
answer

Trigger UPDATE write TXT file

How can I create a trigger that fires every time I have a UPDATE in x column, get the new value to create a new txt file and insert into it. (for synchronization purposes). For example: produtos Layout do txt: 55 | nome_pro...
asked by 24.04.2014 / 16:21
1
answer

Creating Trigger

I need to develop a trigger where any change that occurs in one of these fields below the Task table should send the task information to the Instruction table. TASK TABLE TarefaID Vencimento Status Caminho ModuloID 170123...
asked by 31.10.2017 / 13:14
1
answer

How to restrict the manipulation time of a table?

I would like to know a way to create a trigger in sql-server to restrict the manipulation time of a table between two business hours (8:00 am to 6:00 p.m.).     
asked by 18.09.2015 / 04:15
2
answers

Trigger error

I'm making a system that moves cattle tracking and I'm having a question about creating triggers after update. The situation is this: in my bank there are several tables that have foreign keys to each other. Within these tables, there are the...
asked by 29.10.2016 / 23:13
2
answers

Delete triggers per query

Inquiry To query all triggers of a database, use: SELECT * FROM sys.triggers Failed attempt I've tried delete all or some of triggers contained in the result: DELETE FROM sys.triggers or DELETE FROM sys.triggers W...
asked by 05.09.2018 / 18:36
2
answers

Update tables using trigger, from a main table

I have the following structure: A main table X, where the "header" of the sale is stored. A Y table, where sales items are stored. A Z table, where some sales data will be saved, from triggers fired from table X. In this, every time...
asked by 02.08.2018 / 20:41
1
answer

Error in Sql Server: is not a recognized function name

I have two functions in the sql server that are not being recognized by the database -- Não loga conexões de usuários de sistema IF (ORIGINAL_LOGIN() IN ('sa', 'AUTORIDADE NT\SISTEMA', 'NT AUTHORITY\SYSTEM') OR ORIGINAL_LOGIN() LIKE '%SQLServe...
asked by 15.04.2016 / 17:28
1
answer

Use ON UPDATE CURRENT_TIMESTAMP when changing specific field

Example scenario Table: usuarios Fields: id , nome , sobrenome , senha , timestamp_alteracao Question The timestamp_alteração field should only be updated when the senha field chan...
asked by 28.11.2018 / 12:29
2
answers

Calculation for year "turn" with trigger

How to treat the trigger below so that operations performed between 11/21/2016 and 12/20/2016 return date 01/20/2017 instead of 01/20/2016. p> DECLARE P_COUNT NUMBER(5); DIA_VENDA VARCHAR(2); MES_VENDA VARCHAR(2); MES_...
asked by 10.11.2016 / 18:52
2
answers

Mysql automatically change data [closed]

Good afternoon, I wanted to implement a system that would cause my database to automatically change the value of one of the fields of an element when the expiration date field was higher than the current system date. I've already tried to implem...
asked by 12.05.2015 / 15:14