Hi all,
I'm trying to write a trigger that will raise an error on a field if
it is null on insert.
Example:
I have an item that requires the country of origin. Upon insert, the
user does not put in the country of origin.
How would I write that trigger?
I have so far:
create trigger tI_timItem_COO on dbo.timItem
For Insert
As
If Insert(usefld1) is null
Then
Raiserror('Please enter in a country of origin, 10,1)
Rollback Tran
End
I'm not sure if I'm even close.
Thanks,
Thank you,
Marty Galvan
Business Systems Manager - DBA
Making Memories
[Email address protected] <mailto:[Email address protected]
801-294-0430 x185
MS Sql Server LazyDBA home page