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 2000 Forums
 SQL Server Administration (2000)
 To view or not to view

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-03-31 : 05:02:47
I need to give someone access to a view but want to make the data read only. Any suggestions on the best way to do this?


thanks

steve

A sarcasm detector, what a great idea.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-03-31 : 08:27:58
DENY UPDATE, INSERT, and DELETE permissions on that view to that user. Or, even better, add a NOLOCK hint to the view if you never plan to use it for anything but SELECTs. Adding the hint should make it non-updateable, if not you can add some non-deterministic expressions to the SELECT list (getdate(), etc.) or a TOP 100 PERCENT clause.
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-03-31 : 09:15:00
Brilliant, thanks Rob. I'd already denied access but I knew there was something else, just couldn't find it. I blame that last Martini

Many thanks

steve



A sarcasm detector, what a great idea.
Go to Top of Page
   

- Advertisement -