Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make a field read-only for update without a trigger?

Status
Not open for further replies.

malexanian

IS-IT--Management
Nov 10, 2000
36
US
I want a field to be set by the user on insert but to be read-only after that. Is there a field setting or constraint I can set?

I want to do this WITHOUT A TRIGGER!

Thanks!
 
Well, you can create a stored procedure to do the update and grant the user execute privilges on it;and DO NOT give the user update privileges on the table in question...
 
I do not think you can achieve it without a trigger. You can do as suggested by sguslan or if you do not want that even by mistake there should not be a code in proc which could update the column, there could be another alternative.

You can grant users right to insert/delete on tables but not to update. You also create a view which does not contain the column and you allow users right to update this view. This way even programmatically, anyone will not be able to inadvertantly update the forbidden column.

RT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top