title: Incorrect syntax near the keyword 'DEFAULT' - Unable to modify table
body: <p>I have created a table from this script. The databases are partitioned.</p>
  
  <pre><code>print 'Create Table - tenant_Import'
  go
  
  create table tenant_Import
  (
      Import_Data_Id bigint not null identity(100000000000000, 1),
      Audit_Login_Id bigint not null default 0,
      Tenant_Id bigint not null,
      Tenant_Partition bigint not null,
      Map_Id bigint not null,
      Filename nvarchar(500)  not null,
      DataFile varbinary(max) not null,
      Status int not null,
      DateInserted datetime not null DEFAULT GETDATE(),
      DateProcessed datetime null
  )
  on partition_name_Data(Tenant_Partition)
  go
  
  grant select, insert, update, delete on tenant_Import to a_named_role
  go
  
  alter table tenant_Import
  add constraint pk_Import_Data 
    primary key (Tenant_Partition, Tenant_Id, Import_Data_Id)
    on partition_name_Data(Tenant_Partition)
  go
  
  create index ix1_Import_Data 
  on tenant_Import (Tenant_Partition, Tenant_Id, Map_Id)
  with fillfactor = 75
  on partition_name_Index(Tenant_Partition)
  go
  </code></pre>
  
  <p>I added rows ok into this table.</p>
  
  <p>If I try and change a value (such as null to not null) and click save in SSMS then I get an error:</p>
  
  <blockquote>
    <p>'tenant_Import' table
    - Unable to modify table.   Incorrect syntax near the keyword 'DEFAULT'.</p>
  </blockquote>
  
  <p>Any idea on what could be causing this? This is in SQL Server 2005 Enterprise.</p>
  
  <p>==============================================================================
  The change script as requested by some comments/answers is as follows (I changed DateInserted from not null to null, but the error message happens if I try and change any column):</p>
  
  <pre><code>/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
  BEGIN TRANSACTION
  SET QUOTED_IDENTIFIER ON
  SET ARITHABORT ON
  SET NUMERIC_ROUNDABORT OFF
  SET CONCAT_NULL_YIELDS_NULL ON
  SET ANSI_NULLS ON
  SET ANSI_PADDING ON
  SET ANSI_WARNINGS ON
  COMMIT
  BEGIN TRANSACTION
  GO
  ALTER TABLE dbo.tenant_Import
      DROP CONSTRAINT DF__tenant_Im__Audit__740F363E
  GO
  ALTER TABLE dbo.tenant_Import
      DROP CONSTRAINT DF__tenant_Im__DateI__75035A77
  GO
  CREATE TABLE dbo.Tmp_tenant_Import
      (
      Import_Data_Id bigint NOT NULL IDENTITY (101000000000000, 1),
      Audit_Login_Id bigint NOT NULL,
      Tenant_Id bigint NOT NULL,
      Tenant_Partition bigint NOT NULL,
      Map_Id bigint NOT NULL,
      Filename nvarchar(500) NOT NULL,
      DataFile varbinary(MAX) NOT NULL,
      Status int NOT NULL,
      DateInserted datetime NULL,
      DateProcessed datetime NULL
      )  ON partition_name_Data(Tenant_Partition) 
       TEXTIMAGE_ON  DEFAULT 
  GO
  GRANT DELETE ON dbo.Tmp_tenant_Import TO a_named_role  AS dbo
  GO
  GRANT INSERT ON dbo.Tmp_tenant_Import TO a_named_role  AS dbo
  GO
  GRANT SELECT ON dbo.Tmp_tenant_Import TO a_named_role  AS dbo
  GO
  GRANT UPDATE ON dbo.Tmp_tenant_Import TO a_named_role  AS dbo
  GO
  ALTER TABLE dbo.Tmp_tenant_Import ADD CONSTRAINT
      DF__tenant_Im__Audit__740F363E DEFAULT ((0)) FOR Audit_Login_Id
  GO
  ALTER TABLE dbo.Tmp_tenant_Import ADD CONSTRAINT
      DF__tenant_Im__DateI__75035A77 DEFAULT (getdate()) FOR DateInserted
  GO
  SET IDENTITY_INSERT dbo.Tmp_tenant_Import ON
  GO
  IF EXISTS(SELECT * FROM dbo.tenant_Import)
       EXEC('INSERT INTO dbo.Tmp_tenant_Import (Import_Data_Id, Audit_Login_Id, Tenant_Id, Tenant_Partition, Map_Id, Filename, DataFile, Status, DateInserted, DateProcessed)
          SELECT Import_Data_Id, Audit_Login_Id, Tenant_Id, Tenant_Partition, Map_Id, Filename, DataFile, Status, DateInserted, DateProcessed FROM dbo.tenant_Import WITH (HOLDLOCK TABLOCKX)')
  GO
  SET IDENTITY_INSERT dbo.Tmp_tenant_Import OFF
  GO
  DROP TABLE dbo.tenant_Import
  GO
  EXECUTE sp_rename N'dbo.Tmp_tenant_Import', N'tenant_Import', 'OBJECT' 
  GO
  ALTER TABLE dbo.tenant_Import ADD CONSTRAINT
      pk_Import_Data PRIMARY KEY CLUSTERED 
      (
      Tenant_Partition,
      Tenant_Id,
      Import_Data_Id
      ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON partition_name_Data(Tenant_Partition) 
  
  GO
  CREATE NONCLUSTERED INDEX ix1_Import_Data ON dbo.tenant_Import
      (
      Tenant_Partition,
      Tenant_Id,
      Map_Id
      ) WITH( PAD_INDEX = OFF, FILLFACTOR = 75, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON partition_name_Index(Tenant_Partition) 
  GO
  COMMIT
  </code></pre>