Reply to constraint in Trigger

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация