' Триггер ' Я хочу дать информацию в зависимости от используемой профессии. Например ; Когда я пришел в инженер, я добавил «инженер» Это его имя и фамилия. 'as.
ALTER TRIGGER tigger_example
ON information
AFTER INSERT
AS
IF EXISTS(SELECT * FROM inserted WHERE Person_Job='Engineer')
BEGIN
PRINT 'Engineer added to list.'+
'Person Info:' +
'Name : ' + person_firstname + -- not work
'Surname : ' + person_lastname -- not work
END
ELSE IF EXISTS(SELECT * FROM inserted WHERE Person_Job='Architect')
BEGIN
PRINT 'Architect added to list.'+
'Person Info:' +
'Name : ' + person_firstname + -- not work
'Surname : ' + person_lastname -- not work
END
ELSE
BEGIN
PRINT 'An undefined contact has been added to the list.'
END
ОШИБКА:
The name "person_firstname" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.