May 13, 2003 at 2:32 pm
data is being entered into notes table without the date being set correctly. It appears that people are entering the date within an INSERT statement without letting the default take effect. what other ways that will still allow users to manually enter notes via SQL Query Analyzer, but force the date to be the date and time when the notes are inserted.[
May 13, 2003 at 3:26 pm
Nothing short of a trigger to override. The DEFAULT only takes effect if someone doesn't enter the date/time. If you're allowing data entry via Query Analyzer, then they can choose what fields that want to edit.
What you could do as a workaround is create a view that exposes all the fields except the date/time one. Give the users access to the view, but do not give them access to the table. So long as the owner is the same, ownership chains are in effect. That means they can insert into the view, but the date/time field won't be touched. Then your DEFAULT should take effect.
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply