|
Posted by jay_wic on 05/03/07 21:32
I do not know this is the correct way to do this, but somehow this
isnt working. All I want is not to have a null value in field A if
there is a value in field B
heres the code
CREATE TRIGGER tiu_name ON tblName
FOR INSERT, UPDATE
AS
DECLARE @FieldA AS REAL, @FieldB AS REAL;
SELECT @FieldA=FieldA, @FieldB=FieldB
FROM Inserted;
IF (@FieldB IS NOT NULL) AND (@FieldA IS NULL)
RAISERROR('Error Message',1,2);
GO
Please Help.
Navigation:
[Reply to this message]
|