Can a Trigger be written for a View, that if data is selected from that view to trigger off another transaction?
1 Answer
Probably not. According to documentation, the triggers can be fired by:
DML commands. (I. e. INSERT, UPDATE, DELETE)
DDL commands. ("These events primarily correspond to Transact-SQL CREATE, ALTER, and DROP statements, and certain system stored procedures that perform DDL-like operations.")
LOGON (When someone logs into the SQL Server.)
There might be some creative workarounds to achieve kinda similar thing (depending on what exactly are you trying to do):
Consider e.g. this recent answer, that tracks big SELECTs using extended events. (But does not fire another SQL transaction.)
Or perhaps, instead of view, you could give your consumers stored procedure (inside of which, you will have much more freedom to do as you please).