www.webdeveloper.com
Results 1 to 3 of 3

Thread: Why can't I turn the default of a column into an empty string?

  1. #1
    Join Date
    Mar 2010
    Posts
    701

    Why can't I turn the default of a column into an empty string?

    I have a few columns that have a default of NULL. I tried turning them into "As define:" (empty string) with phpMyAdmin many times before. But it's still NULL and it's causing errors in my script.

  2. #2
    Join Date
    Aug 2009
    Posts
    593
    If your trying to set a default value for a TEXT type column it's not going to accept it.
    Easy solution is to set the column to allow null values.

    Eg.

    Code:
    ALTER TABLE [table_name] MODIFY COLUMN [column_name] TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL;

  3. #3
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Have you tried setting the default value to two apostophes? ''

    This is how I set a blank as the default in MS-SQL Server, via Management Studio Express.

    ^_^

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles