Will change tracking continue to work if a new table is renamed to original table name

96 views Asked by At

I have a scenario where change tracking is enabled on a Table (say tblABC). This table has IDENTITY set on its primary key column (ID). I plan to remove the IDENTITY spec from this column. The best way suggested to do this is an ALTER TABLE..SWITCH TO, but this process involves new table to be created and renamed back to original table name like so.

EXEC sys.sp_rename 'Original2', 'Original', 'OBJECT';

I'm not sure if renaming a new table to original name will still keep the change tracking on it. Can a new table be renamed such that change tracking is not lost?

1

There are 1 answers

1
Kazi Mohammad Ali Nur Romel On

You can remove identity from the design view.

  1. Right-click on the table and select Design
  2. Then select the identity column
  3. After that, in the column property tab at the bottom expend identity specification
  4. Then select No for (Is Identity) row
  5. Save the changes.

If you are seeing the Save (Not Permitted) Dialog Box then on the Tools menu, click Options, expand Designers, and then click Table and Database Designers. Select or clear the Prevent saving changes that require the table to be re-created check box.

From learn.microsoft.com