ALTER Table

  • I have a couple of questions regardng ALTER Table.

    1)  How do I add DEFAULT -1 to

    ALTER TABLE [dbo].[xtable]  ADD

     

  • ALTER TABLE dbo.xTable ADD CONSTRAINT

    DF_name DEFAULT 'Yourvalue' FOR YourTable

    GO

  • Thanks.

    I guess part of my Post got cut off.

    Another question.

    With ALTER TABLE, can I change the name of a column?  Like xtable.xcolumn to xtable.zcolumn.

    Phil

     

     

  • exec sp_rename 'tablename.colname', 'newcolname', 'COLUMN'

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply