PRB: Error 4928 Occurs When You Try to Rename a Non-Replicated Column (811899)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 7.0

SYMPTOMS

When you try to rename a column of a table that is not replicated, you may receive an error message similar to:
4928: Cannot alter column '%.*ls' because it is '%ls'.

For example, your error message might contain this text:
Cannot alter column 'notes' because it is 'REPLICATED'.

CAUSE

The replication process marks databases, database objects and columns to indicate their
involvement in replication. However, when replication is removed on the database, those indicators
that are marked may not be reset.

WORKAROUND

Important: Do not use the following workaround if the object is being used for replication. This problem is specific to cases where all replication has been removed from the database but there are objects that remain incorrectly flagged as involved in replication. Using the following procedure on a database that is still replicated is not supported and may break replication on the server.

Steps to Take Before You Work Around This Problem
  1. Verify that the column is marked for replication. You can check the syscolumns
    table in your database to verify this. For example, run the following query against
    the database that contains the column that you want to rename. Replace column_name
    with the name of the column that you want to rename:
    SELECT  * 
    FROM syscolumns
    WHERE name = 'column_name'

    The column is marked for replication only when the colstat column value is
    greater than or equal to 4096.
  2. Make sure to have a contingency plan, such as a database backup. Microsoft
    recommends that you make a full database backup of the database before you
    use the workaround. For more information about the BACKUP command,
    see the "BACKUP, Transact-SQL Reference" topic in SQL Server Books Online.

Steps to Work Around The Behavior

Notes
  • The following procedure is dependent on SQL Server system tables. The structure
    of the system tables may vary in different SQL Server versions. Microsoft does not
    recommend that you select directly from the system tables.
  • In most cases, Microsoft does not recommend that you change system tables
    directly. For example, do not try to modify system tables by using DELETE,
    UPDATE, or INSERT statements, or by using user-defined triggers.

After you make sure that the marked columns in the database are not used by replication,
follow these steps:


  1. Run the following code to clear the replication indicators on the columns.
    sp_configure 'allow updates', 1
    go
    reconfigure with override
    go
    begin transaction
    UPDATE syscolumns
    SET colstat = colstat & ~4096
    WHERE colstat & 4096 <>0
    go
  2. Verify that rows were affected. If the intended rows in the syscolumns table were
    updated, commit the transaction, or roll back the transaction by using one of these commands:
    rollback transaction
    go
         -or-
    commit transaction
    go
  3. Run the following code to set the server configuration back:
    sp_configure 'allow updates', 0
    go
    reconfigure with override
    go

REFERENCES

SQL Server 2000 Books Online; topics: "Backing Up and Restoring Replication Databases"; "Strategies for Backing Up and Restoring Merge Replication"; "Strategies for Backing Up and Restoring Transactional Replication"; "Strategies for Backing Up and Restoring Snapshot Replication"; "sp_restoredbreplication"; "sp_vupgrade_replication"; "sp_configure"; "System Tables"

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

326352 PRB: You Receive Error 3724 When You Drop a Non-Replicated Object


Modification Type:MajorLast Reviewed:10/17/2003
Keywords:kberrmsg kbprb KB811899 kbAudDeveloper