Skip to content

Create table statement

Tako Lee edited this page Feb 16, 2014 · 25 revisions
  • Fields fit into one line

    • Fields in the same line as CREATE TABLE keyword

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

      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 
          ) ;       
Clone this wiki locally