Skip to content

Create table statement

Tako Lee edited this page Mar 7, 2014 · 25 revisions
  • create table fit into one line

    Option: fmt068_createtable_fit_into_one_line = true, type: TFmtBoolean.

    Try to fit statement into one line when length less than line width, it's this option is false, then won't try to do this.

    CREATE TABLE dbo.mytable ( low int, high int, myavg AS (low + high)/2 ) ;
  • Field list style

    • Fit into one line

      Option: fmt069_createtable_field_list_style = fit_into_one_line, type: TFmtListStyle.

      CREATE TABLE dbo.mytable 
        ( low int, high int, myavg AS (low + high)/2 ) ;
    • Stacked

      Option: fmt069_createtable_field_list_style = stacked, type: TFmtListStyle.

      CREATE TABLE dbo.mytable ( low  int,
                                 high int, 
                                 myavg AS (low + high)/2 ) ;       
  • Stacked fields

    • Fields in the same line as CREATE TABLE keyword

      • Comma in the end of line

        CREATE TABLE dbo.mytable ( low  int,
                                   high int, 
                                   myavg AS (low + high)/2 ) ;       
      • Comma in the begin of line

        CREATE TABLE dbo.mytable ( low   int
                                   ,high int 
                                   ,myavg AS (low + high)/2 ) ;       
      • Comma in the begin of line, align with fields

        CREATE TABLE dbo.mytable ( low  int
                                  ,high int 
                                  ,myavg AS (low + high)/2 ) ;       
      • Comma in the begin of line, align with fields, space between comma and field in 1 or n

        CREATE TABLE dbo.mytable (  low  int
                                  , high int 
                                  , myavg AS (low + high)/2 ) ;       
    • Fields in new line, indented by 0 or n.

      • Comma in the end of line

        CREATE TABLE dbo.mytable ( 
          low  int,
          high int, 
          myavg AS (low + high)/2 ) ;       
      • Comma in the begin of line

        CREATE TABLE dbo.mytable ( 
          low   int
          ,high int 
          ,myavg AS (low + high)/2 ) ;       
      • Comma in the begin of line, align with fields

        CREATE TABLE dbo.mytable ( 
           low  int
          ,high int 
          ,myavg AS (low + high)/2 ) ;       
      • Comma in the begin of line, align with fields, space between comma and field in 1 or n

        CREATE TABLE dbo.mytable (  
           low  int
         , high int 
         , myavg AS (low + high)/2 ) ;       
    • Left/right parentheses in new line

      • Comma in the end of line

        CREATE TABLE dbo.mytable 
          ( 
             low  int,
             high int, 
             myavg AS (low + high)/2 
          ) ;       
      • Comma in the begin of line

        CREATE TABLE dbo.mytable 
          ( 
             low   int
             ,high int 
             ,myavg AS (low + high)/2 
          ) ;       
      • Comma in the begin of line, align with fields

        CREATE TABLE dbo.mytable 
          ( 
              low  int
             ,high int 
             ,myavg AS (low + high)/2 
          ) ;       
      • Comma in the begin of line, align with fields, space between comma and field in 1 or n

        CREATE TABLE dbo.mytable 
          ( 
               low  int
             , high int 
             , myavg AS (low + high)/2 
          ) ;       
  • Create table as select, indent AS keyword from 0 to n

    CREATE TABLE suppliers
      AS (SELECT *
          FROM companies
          WHERE id > 1000);
Clone this wiki locally