Basic MSSQL Query help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sethupathy22
    New Member
    • Feb 2008
    • 4

    Basic MSSQL Query help

    Hi guys ,

    i have a basic query question, sorry i am not familiar with all the terms so bare with me

    i have a table called Persons and a row called Pers_statut which is a choise box (Active and Inactive) i want to set everyone to Active

    i thought this would work but didnt

    UPDATE Persons
    SET Pers_statut = 'Active'
    WHERE Pers_statut = ' '

    when i execute i get 0 rows affected

    Can someone Help
    Thank you
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by sethupathy22
    Hi guys ,

    i have a basic query question, sorry i am not familiar with all the terms so bare with me

    i have a table called Persons and a row called Pers_statut which is a choise box (Active and Inactive) i want to set everyone to Active

    i thought this would work but didnt

    UPDATE Persons
    SET Pers_statut = 'Active'
    WHERE Pers_statut = ' '

    when i execute i get 0 rows affected

    Can someone Help
    Thank you
    Try this:

    [code=sql]

    UPDATE Persons
    SET Pers_statut = 'Active'
    WHERE Pers_statut IS NULL

    [/code]

    Comment

    • sethupathy22
      New Member
      • Feb 2008
      • 4

      #3
      Originally posted by amitpatel66
      Try this:

      [code=sql]

      UPDATE Persons
      SET Pers_statut = 'Active'
      WHERE Pers_statut IS NULL

      [/code]

      Thanks in worked , and thanks for the line

      WHERE Pers_statut IS NULL

      i forgot that i have modified some manually

      SOLVED

      Comment

      Working...