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. Blank default values for varchar field

Blank default values for varchar field

Scheduled Pinned Locked Moved Database
questiondatabasesql-serversysadminxml
4 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.
  • H Offline
    H Offline
    hertz_j
    wrote on last edited by
    #1

    Hi I want to use a blank (empty string but not null) as a default value for varchar column in SQL server 2000. Is this possible and if it is, how do I do it (in Enterprise Manager if possible)? Just so that I don’t get a lot of why do you want to do that answers. The underlying data access layer I use need blank values or it won’t create a correct xml files. Thanks Johan

    R E 2 Replies Last reply
    0
    • H hertz_j

      Hi I want to use a blank (empty string but not null) as a default value for varchar column in SQL server 2000. Is this possible and if it is, how do I do it (in Enterprise Manager if possible)? Just so that I don’t get a lot of why do you want to do that answers. The underlying data access layer I use need blank values or it won’t create a correct xml files. Thanks Johan

      R Offline
      R Offline
      Ramya SM
      wrote on last edited by
      #2

      Simply use "Create table Table1(col1 int, col2 varchar default ' ') Ramya -- modified at 5:53 Friday 12th May, 2006

      1 Reply Last reply
      0
      • H hertz_j

        Hi I want to use a blank (empty string but not null) as a default value for varchar column in SQL server 2000. Is this possible and if it is, how do I do it (in Enterprise Manager if possible)? Just so that I don’t get a lot of why do you want to do that answers. The underlying data access layer I use need blank values or it won’t create a correct xml files. Thanks Johan

        E Offline
        E Offline
        Eric Dahlvang
        wrote on last edited by
        #3

        hertz_j wrote:

        in Enterprise Manager if possible)

        In the Columns Property Page put SPACE(0) as the Default Value. ---------- There go my people. I must find out where they are going so I can lead them. - Alexander Ledru-Rollin

        H 1 Reply Last reply
        0
        • E Eric Dahlvang

          hertz_j wrote:

          in Enterprise Manager if possible)

          In the Columns Property Page put SPACE(0) as the Default Value. ---------- There go my people. I must find out where they are going so I can lead them. - Alexander Ledru-Rollin

          H Offline
          H Offline
          hertz_j
          wrote on last edited by
          #4

          Hi Eric, I'll try that, thank you.

          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