I have a system that that passes values from tablets to a sql server. In that processes the values are passed to variables. if the user did not change a value then the system passes a null....
I need to be able to perform a check against the variable to see if it is null and then update if it is not..
I had this working using IF statements but cannot get it to work with case (this is the first time I have used case - just learning)
I decided to switch to case because i thought I could simplify things (there are more cases, but i managed to get stuck on the first :)
Here is what i have, and it updates the table if the value is null (and of course it it is not)
thanks for your help in advance
declare @How_many_on_shelf float
declare @InventoryID as int
set @How_many_on_shelf = null
set @InventoryID = 2
set Onshelf = Case
When @How_many_on_shelf is not null then @How_many_on_shelf
Where ItemId = @InventoryID