Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To: Prevent record update if
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00877709
Message ID:
00877716
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>Somehow, I've got a "bug" in my vfp application that the user can occanically manage to "move" a scheduled event to the year 1899, what I'm guessing is was some type of invalid invalid date value during the udpate. It has only happened 3 times in the last 12 months, so it's fairly rare, but I'm hoping I can prevent the record at the database level from being updated if the year portion of the date being updated is two years prior to the current system date. I don't know enough about writting triggers to know if I can do this in like a instead of type of trigger.
>
>Thanks for any pointers.
>
Kirk,

You can use Check Constraint
datepart(year,[mydate]) >= datepart(year,getdate()) - 2)
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform