SQL core

Can a specific mesh trigger be created?

Or

IF UPDATE(COLUMN) WHERE OTHER_COLUMN LIKE 'JT'

equivalent present in SQL Server 2008?

EDIT after receiving the second answer ---

IF not UPDATE(CurrentNo) --// Wanted to do like this : where series ='JT'
    return

IF not EXISTS(SELECT 'True'
              FROM Inserted i
              JOIN Deleted d ON i.Series = d.Series
              WHERE i.Series = 'JT' AND d.Series = 'JT')
    return

Everything seems to be in order! Please comment.

+1
source share
2 answers

No. There is no way to do this declaratively. You will need to create a common update trigger and put logic in it to return immediatelyIF NOT UPDATE (column)

If the column of interest has been updated, you will request pseudo-tables insertedand deletedso that you can process the rows in which your condition is satisfied.

+1
source

, , . INSERTED DELETED. , , . UPDATE(), SQL Server 2008 ( ), , .

0

Source: https://habr.com/ru/post/1768938/


All Articles