June 19, 2009 at 1:36 am
Hello,
I have written a trigger to update a certain field, the trigger is working properly.
I explain what I'm trying to do.
I have a certain field in a certain table.
I compare certain values in that table with another table and I take the value from another table.
This all works fine
But when the value is NULL in the other table he always returns null, what is normal.
But when the value is null the user would like to put a value in that table himself, but then always the trigger fires and return value NULL
Is there any possibility to solve that so It is also getting possible for the user to change the value for a certain field without the trigger fires.
Thx
ken
June 19, 2009 at 7:50 am
For the Null values try to use ISNULL if you can do something so for better solution read my sig !
more info here: http://msdn.microsoft.com/en-us/library/ms184325.aspx
June 19, 2009 at 8:22 am
Dugi's got you on the right track. use ISNULL to put in a default value, or raise an error before it gets to the trigger in the first place.
as an FYI, no trigger/storedproc/function can raise any MsgBoxes/inpout boxes for user input; even if it did, the inputbox would open on the sERVER where the code gets executed, not at the client statiuon, right?
you'd need to get your user interface to check the values before they get passed to the server.
Lowell
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply