Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. convert EMPTY fields to NULL?

convert EMPTY fields to NULL?

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelptutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John Sundar
    wrote on last edited by
    #1

    how to insert null to an EMPTY cell in SQL SERVER... i.e, in a field, i enter some values and deleted it. so, it is considered as EMPTY field and not null. i need a query to make that field <NULL> can anyone help me? - KARAN

    K S 3 Replies Last reply
    0
    • J John Sundar

      how to insert null to an EMPTY cell in SQL SERVER... i.e, in a field, i enter some values and deleted it. so, it is considered as EMPTY field and not null. i need a query to make that field <NULL> can anyone help me? - KARAN

      K Offline
      K Offline
      Krish KP
      wrote on last edited by
      #2

      UPDATE SET = NULL WHERE LEN() = 0 this works for string data even recollect reading IsEmpty() function in SQL Server you may even try with this. I've never used this function.

      Regards KP

      1 Reply Last reply
      0
      • J John Sundar

        how to insert null to an EMPTY cell in SQL SERVER... i.e, in a field, i enter some values and deleted it. so, it is considered as EMPTY field and not null. i need a query to make that field <NULL> can anyone help me? - KARAN

        K Offline
        K Offline
        Krish KP
        wrote on last edited by
        #3

        UPDATE TableA SET ColA = NULL WHERE LEN(ColA) = 0 this works for string data even recollect reading IsEmpty() function in SQL Server you may even try with this. I've never used this function.

        Regards KP

        J 1 Reply Last reply
        0
        • J John Sundar

          how to insert null to an EMPTY cell in SQL SERVER... i.e, in a field, i enter some values and deleted it. so, it is considered as EMPTY field and not null. i need a query to make that field <NULL> can anyone help me? - KARAN

          S Offline
          S Offline
          SeeSharp 0
          wrote on last edited by
          #4

          This solution is when you are manually putting data in the fields rom enterprise manager. Just click on the cell and do " control 0 ". That is press control key and zero. this will get NULL value in the empty field. -Naina

          --Here 2 See Sharp-- I have not failed. I've just found 10,000 ways that won't work. :)

          J 1 Reply Last reply
          0
          • S SeeSharp 0

            This solution is when you are manually putting data in the fields rom enterprise manager. Just click on the cell and do " control 0 ". That is press control key and zero. this will get NULL value in the empty field. -Naina

            --Here 2 See Sharp-- I have not failed. I've just found 10,000 ways that won't work. :)

            J Offline
            J Offline
            John Sundar
            wrote on last edited by
            #5

            thanks seesharp...but i need it programmatically

            1 Reply Last reply
            0
            • K Krish KP

              UPDATE TableA SET ColA = NULL WHERE LEN(ColA) = 0 this works for string data even recollect reading IsEmpty() function in SQL Server you may even try with this. I've never used this function.

              Regards KP

              J Offline
              J Offline
              John Sundar
              wrote on last edited by
              #6

              thanks a lot krish-KP... can i have it for DATETIME field also? i.e.. when the DATETIME field is EMPTY or 1/1/1900, it should be of . how to achieve it? - KARAN

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups