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
 General SQL Server Forums
 New to SQL Server Programming
 Table read only

Author  Topic 

Kabila
Starting Member

33 Posts

Posted - 2009-09-24 : 08:05:46
How to make a table read only in sql 2005?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-09-24 : 08:13:35
DENY INSERT, UPDATE, DELETE ON myTable TO public

That should be a good start.
Go to Top of Page

Kabila
Starting Member

33 Posts

Posted - 2009-09-24 : 08:47:50
Any other way?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-24 : 09:04:02
quote:
Originally posted by Kabila

Any other way?


Why?
What is wrong with the above suggestion?

Another method is to create a view like this and give access to that view only (But may not be effecient)

create view my_view
as
select columns from table
union
select top 1 columns from table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kabila
Starting Member

33 Posts

Posted - 2009-09-24 : 09:21:10
Database permission is not set by me. Any another way?Plz...
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-09-24 : 09:54:09
Can't think of one except to write a trigger to always roll back. But if you can't set permissions on tables then it's unlikely you can create triggers.
Go to Top of Page
   

- Advertisement -