dbdoshi
asked on
Trigger on SELECT
Hello, I am trying to write a trigger which will allow me to intercept a SELECT statement and depending on the WHERE clause in the SELECT statement, I want to output a resultset. For example,
SELECT col FROM A WHERE x = 5;
Ordinarily, it might return
xyz
abc
pqr
Now, if the above query executes against the server, I want to catch it before it executes and return something like
mno
Thus, depending on where clause I wish to manipulate the resultset.
Thanks.
SELECT col FROM A WHERE x = 5;
Ordinarily, it might return
xyz
abc
pqr
Now, if the above query executes against the server, I want to catch it before it executes and return something like
mno
Thus, depending on where clause I wish to manipulate the resultset.
Thanks.
Could you maybe use a stored procedure for something like this instead of a trigger?
Well a view is the closest thing I could think of..
ASKER
Yes, anything will go. View or Stored Proc? Can somebody give a little example.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Triggers only fire on update/delete/insert.