locked
SQL 2008 Design mode table does not allow change from Not null to NUll RRS feed

  • Question

  • Hi,

    In sql 2008 I try to edit an empty (also happens on non-empty) table a column that is 'Not Null' to 'Null'. And I get an error saying that it must drop and recreate the table.
    However I am able to do this via t-sql using the script below:

    alter

     

    table dbo.Table_2 alter column Col2 nchar(10) not Null

    Why is this happening, is there an explanation for this or is this a bug?

    Thanks

    Monday, November 30, 2009 4:59 PM

Answers

  • Go to tools/options/designers/table and database designers.  Uncheck "Prevent saving changes that require table re-creation."
    • Marked as answer by Kaly81 Monday, November 30, 2009 6:15 PM
    Monday, November 30, 2009 5:21 PM

All replies

  • Go to tools/options/designers/table and database designers.  Uncheck "Prevent saving changes that require table re-creation."
    • Marked as answer by Kaly81 Monday, November 30, 2009 6:15 PM
    Monday, November 30, 2009 5:21 PM
  • ... however, there's a reason this is off by default!
    Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi
    Monday, November 30, 2009 7:52 PM