Results 1 to 2 of 2

Thread: ALTER IDENTITY COLUMN

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 1999
    Location
    Oak Park, IL, USA
    Posts
    43

    Post

    I need to send this:

    ALTER TABLE LMSBillHdr ALTER COLUMN LMSBillingID IDENTITY(1000,1)

    Im wondering why that is failing, its bad syntax, but what is the good syntax for that?

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    from SQL server books online (T-SQL):
    Code:
    ALTER TABLE table
    {    [ALTER COLUMN column_name
            {    new_data_type [ (precision[, scale] ) ]
                        [ NULL | NOT NULL ]
                | {ADD | DROP} ROWGUIDCOL
            }
        ]
        | ADD
            {    [ <column_definition> ]
                |  column_name AS computed_column_expression
            }[,...n]
        | [WITH CHECK | WITH NOCHECK] ADD
            { <table_constraint> }[,...n]
        | DROP
            {    [CONSTRAINT] constraint_name
                | COLUMN column
            }[,...n]
        | {CHECK | NOCHECK} CONSTRAINT
            {ALL | constraint_name[,...n]}
        | {ENABLE | DISABLE} TRIGGER
            {ALL | trigger_name[,...n]}
    }
    
    <column_definition> ::= { column_name data_type }
    [ [ DEFAULT constant_expression ]
    | [ IDENTITY [(seed, increment ) [NOT FOR REPLICATION] ] ]
    ]
    [ ROWGUIDCOL ]
    [ <column_constraint>] [ ...n]
    
    <column_constraint> ::= [CONSTRAINT constraint_name]
    {
        [ NULL | NOT NULL ]
        | [    { PRIMARY KEY | UNIQUE }
            [CLUSTERED | NONCLUSTERED]
            [WITH FILLFACTOR = fillfactor]
            [ON {filegroup | DEFAULT} ]]
         ]
        | [    [FOREIGN KEY]
            REFERENCES ref_table [(ref_column) ]
            [NOT FOR REPLICATION]
         ]
        | CHECK [NOT FOR REPLICATION]
            (logical_expression)
    }
    
    
    <table_constraint> ::= [CONSTRAINT constraint_name]
    {    [    { PRIMARY KEY | UNIQUE }
            [ CLUSTERED | NONCLUSTERED]
            { ( column[,...n] ) }
            [ WITH FILLFACTOR = fillfactor]
            [ON {filegroup | DEFAULT} ]
        ]
        |    FOREIGN KEY
                [(column[,...n])]
                REFERENCES ref_table [(ref_column[,...n])]
                [NOT FOR REPLICATION]
        |    DEFAULT constant_expression
                [FOR column]
        |    CHECK [NOT FOR REPLICATION]
            (logical_expression)
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width