I am using Microsoft SQL Server and SQL Server Management Studio.
I have a column called dateApplied which has a constraint like this:
[dateApplied] >= getDate()
When I enter a row the date is automatically added the row.
My problem is when I use the SELECT function, the dateApplied column is automatically changed to the current date and time in which the SELECT statement is called.
How do I prevent this from happening?
Thanks
Peter
I suppose you’re using a computed column, like:
Try a default constraint instead:
A computed column is calculated whenever you run a query. A default constraint is only generated when the row is first inserted.