June 14, 2007 at 7:54 am
Is is possible to grant Select right to a view, and then limit that right to a time frame, such as 9 AM to noon?
Thanks,
Arthur
June 14, 2007 at 8:02 am
Arthur
Not as far as I know. Although you could change the view to a stored procedure, and put some conditional logic in that.
John
June 14, 2007 at 8:47 pm
Hi Its 2.45 pm here, I get results from klh1 and nothing from klh2. The trick is that each predicate must be true, therefore we can limit by time of day
create view klh1 as
select *
from contact_details
where username like 'a%'
and datepart(hh, getdate()) between 12 and 15
create view klh2 as
select *
from contact_details
where username like 'a%'
and datepart(hh, getdate()) between 1 and 5
Regards
Karl
June 15, 2007 at 11:04 am
Thank you, both of you. Both solutions offer good possibilities.
"User", not "Username" works for me. Using datepart() is very simple and works nicely.
Arthur
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply