Different ways to restrict the user to enter/update column value

  • Hi All, its a foolish :ermm: question to ask you all experts, but just wanted to know your thoughts on this scenario.

    We have one scenario where have LastUpdated column across all the tables in the database. Currently we are inserting the GETUTCDATE() from application code. We want to restrict it app. code level.

    What we want to do is to handle it @ database level. The LastUpdated column should be inserted/updated whenever a new record is inserted or existing record is updated from the application. Even though the it has been written in the app. code (SQL Query) it should handle it @ Database level. One way to do it I have mentioned below can you suggest me any other way....:ermm:

    Your suggestions are appreciated.

    -Abhijit More

    http://abhijitmore.wordpress.com/

    Abhijit - http://abhijitmore.wordpress.com

  • 1. Instead of / After TRIGGER.

    2. Ensure all modifications go through a stored procedure, and enforce it there.

  • We are not using stored procedures. Dn't ask me y:w00t:

    Abhijit - http://abhijitmore.wordpress.com

  • Abhijit More (3/12/2010)


    We are not using stored procedures. Dn't ask me y:w00t:

    To make your life harder? To bloat the procedure cache?

  • yeah this is the funny situation where i am stuck now...;-) any solutions to get out of it

    Abhijit - http://abhijitmore.wordpress.com

  • Update your CV?

    :laugh:

  • Nice answer Paul :). Thanks for your solutions.

    Abhijit - http://abhijitmore.wordpress.com

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply