Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2011
    Posts
    28

    Unanswered: [solved]update where I find null values

    Hello

    I am trying to mask data on a table, this table has 15 columns but no in all the columns has information, what I am trying to do its update the information if its no null but I haven have success, what I am trying its the follow (obiusly doesnt work).

    DECLARE @i VARCHAR(15)
    DECLARE @j VARCHAR(15)

    SET @j = 'test'
    SET @i = ''

    UPDATE nodir
    SET rfc = @i
    WHERE isnull(name,SET @i = @j)

    can you help me with this?

    Regards
    Last edited by eldeleon; 06-29-11 at 15:06. Reason: solved

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    I don't understand your question - perhaps you should give some examples of what you want updated.

  3. #3
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    It's not by any chance as simple as this?
    update <tablename>
    set <columnname> = <value<
    where <columnname> is null
    I'm not crazy, I'm an aeroplane!

  4. #4
    Join Date
    Jun 2011
    Posts
    28
    Actually I finally resolved like this.

    UPDATE nodir SET
    CASE WHEN rfc = NULL THEN 0 ELSE 1 END 'test',


    thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •