Posts

Showing posts from April, 2020

When we add a column with default constraint will the Ct version changes or not

use prism /* Creating a table*/ Create table dbo.Prismtest ( Id int primary key identity(1,1), [Name] Varchar(10)) alter table dbo.Prismtest add [Address2] varchar(100) default('abc') not null  select * from dbo.prismtest insert into dbo.Prismtest ([Name]) values ('def' )  select ct.* FROM changetable(changes dbo.Prismtest,1 ) as ct  LEFT JOIN dbo.Prismtest a on a.id=ct.id  -- 54067710    /Checking the data in CT table*/ select change_tracking_Current_version()  -- 54067711  /* Here check the CT version is getting changed or not  -- Important */  Alter table dbo.Prismtest Enable change_tracking WITH (TRACK_COLUMNS_UPDATED = OFF);