is null with parameters

  • I keep getting the following error when trying to test if a parameter is null:

      Message="The specified argument value for the function is not valid. [ Argument # = 1,Name of function(if known) = isnull ]"

      HResult=-2147217900

      NativeError=25922

    Is it not possible to test if a parameter is null?

    What I'm trying to do is something like: (standard optimistic concurrency)

    UPDATE ... SET field = @field

    WHERE ...

    AND (field is null AND @old_field is null OR field = @old_field)

    Also, is it possible to set the values of parameters in management studio when testing some of these queries?

  • It seems that checking if a parameter is null is not supported by SQL Mobile.

    Also SQL Mobile doesn't support timestamps.

    Thus the only two simple solutions I can think of were:

    Having a column which is always set to newid() on any insert/update, just be sure that you always update it.

    Having a column which is set to getdate() on any insert/update, again be sure to always update it. This would not be as effective in high concurrency where two updates could occur at the same time, but on a mobile device this is less likely.

    In my case the use of the concurrency checks is just for sanity to make sure a different part of the progam doesn't try to commit a stale copy of a row (this shouldn't happen and is an error anyway).

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply