Results 1 to 5 of 5

Thread: Column

  1. #1

    Thread Starter
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950

    Column

    Hey,

    Is it possible to change a column's Allow Nulls property after the table has been created?

    Thanks,
    Don't anthropomorphize computers -- they hate it

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    ALTER TABLE tablename MODIFY columnname varchar(50) NULL;

  3. #3
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    This will fail
    if
    you modify to not allow null
    and
    the column has already null value
    Regards

  4. #4
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    Just update the column where it is null:
    Code:
    Update myTable
    Set Field1 = 'SomeValue'
    Where Field1 Is NULL
    Then run mendhak's suggestion.
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  5. #5
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    Thats true
    Regards

Posting Permissions

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



Click Here to Expand Forum to Full Width