Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011
    Posts
    2

    Question Unanswered: Alter Table Help

    Need to add RowGUID column to tables and I'm running into some trouble. Not really familiar with all the uses of ALTER TABLE.

    Attempting to execute this:

    ALTER TABLE My_Table ADD [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL

    However, I'm sure I'm getting error messages because the column is being inserted as NULL values. So I want to give it a DEFAULT value I just don't know the best way or the syntax for that statement.

    Suggestions? -Please help!

    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Code:
    ALTER TABLE My_Table ADD [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL default(newid())

Posting Permissions

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