Enabling Stretch Database for a table by using Transact-SQL

In order to support table stretching, the CREATE and ALTER TABLE statements have been extended in SQL Server 2016. Here is the syntax extension for the ALTER TABLE statement that supports the Stretch DB feature:

<stretch_configuration> ::=   
    {   
      SET (   
        REMOTE_DATA_ARCHIVE    
        {   
            = ON (  <table_stretch_options>  )   
          | = OFF_WITHOUT_DATA_RECOVERY ( MIGRATION_STATE = PAUSED )   
          | ( <table_stretch_options> [, ...n] )   
        }   
            )   
    }   
   
<table_stretch_options> ::=   
    {   
     [ FILTER_PREDICATE = { null | table_predicate_function } , ]   
       MIGRATION_STATE = { OUTBOUND | INBOUND | PAUSED }   
    }   
 

You can specify the following options to enable Stretch DB:

  • REMOTE_DATA_ARCHIVE is required and can have these values: ON, OFF_WITHOUT_DATA_RECOVERY ...

Get SQL Server 2017 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.