Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to Identify when SELECT is used?

Author  Topic 

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2010-10-28 : 00:55:34
I know you can set a trigger to fire if an UPDATE, DELETE or INSERT has been used on a table, but is there a way of knowing when a SELECT is used?

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-28 : 01:52:08
Have a look at:

http://www.mssqltips.com/tip.asp?tip=1649

Regards,
Bohra

I am here to learn from Masters and help new bees in learning.
Go to Top of Page

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2010-10-28 : 02:23:54
Thanks, thats a good starter for me, now need to know if I can fire a triggger or control when a select is made on a table by a user who is allowed to view certain data in that table.
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-10-28 : 03:15:18
quote:
Originally posted by Bill_C

Thanks, thats a good starter for me



You are welcome
quote:
now need to know if I can fire a triggger or control when a select is made on a table by a user who is allowed to view certain data in that table.



I don't think it is possible. AFAIK you cannot fire a trigger on Select.
Triggers can be fired for DDL & DML operation.
Select is DQL (Data query language) operation.
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2010-10-28 : 12:05:31
I'm not aware of anyway to implement a trigger on a select. I think what you need to do is implement your security in a view.
Go to Top of Page
   

- Advertisement -