title: Alter GENERATED ALWAYS colum into a GENERATED BY DEFAULT identity column - Sql Server
body: <p>I need to change the Existing Table Column, which is configured as <code>GENERATED ALWAYS</code> into a <code>GENERATED BY DEFAULT</code>.</p>
  
  <p>Sample Table Structure</p>
  
  <pre><code>CREATE TABLE [dbo].[Contact](
      [ContactID] [uniqueidentifier] NOT NULL,
      [ContactNumber] [nvarchar](50) NOT NULL,
      [SequenceID] [int] IDENTITY(1,1) NOT NULL,
      [SysStartTime] [datetime2](0) GENERATED ALWAYS AS ROW START NOT NULL,
      [SysEndTime] [datetime2](0) GENERATED ALWAYS AS ROW END NOT NULL,
   CONSTRAINT [PK_Contact] PRIMARY KEY NONCLUSTERED 
  (
      [ContactID] ASC
  )WITH (PAD_INDEX = OFF, 
         STATISTICS_NORECOMPUTE = OFF, 
         IGNORE_DUP_KEY = OFF, 
         ALLOW_ROW_LOCKS = ON, 
         ALLOW_PAGE_LOCKS = ON) 
     ON [PRIMARY],
  PERIOD FOR SYSTEM_TIME ([SysStartTime], [SysEndTime])
  ) ON [PRIMARY]
  WITH
  (
      SYSTEM_VERSIONING = ON (HISTORY_TABLE = [dbo].[ContactHistory],
                              DATA_CONSISTENCY_CHECK = ON )
  )
  </code></pre>
  
  <p>This is the table I'm already having now I need to change the column 
  <code>[SysStartTime]</code> to <code>GENERATED BY DEFAULT</code> from <code>GENERATED ALWAYS</code></p>
  
  <p>I tried the following code</p>
  
  <pre><code>ALTER TABLE dbo.Contact ALTER column SysStartTime SET GENERATED BY DEFAULT
  </code></pre>
  
  <p>But it throws an error</p>
  
  <blockquote>
    <p>Msg 156, Level 15, State 1, Line 19 Incorrect syntax near the keyword
    'SET'.</p>
  </blockquote>
  
  <p>Kindly assist me.</p>