Cannot alter column because it is 'ROWGUIDCOL'

Ludmil G 101 Reputation points
2024-05-30T09:28:42.0733333+00:00

After restoring a database one of my columns was changed from NULL to newid(). I tried to run

ALTER TABLE Table1 ALTER COLUMN Id uniqueidentifier NULL

script and I got 'Cannot alter column Id because it is 'ROWGUIDCOL'

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 47,436 Reputation points
    2024-05-30T10:34:57.53+00:00

    'Cannot alter column Id because it is 'ROWGUIDCOL'

    As the message says, the column has the property ROWGUIDCOL set, you would have to remove it, but carefully, the property is for replication and if you remove it, you break replication.

    See

    https://learn.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql?view=sql-server-ver16

    => ROWGUIDCOL

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.