After years of using TSQL, I still cannot figure out when to use SET
, WITH
or ENABLE
.
When you read TSQL statement like,
ALTER TABLE Person.Person
ENABLE CHANGE_TRACKING
WITH (TRACK_COLUMNS_UPDATED = ON);
It looks more intuitive and readable if it was written like (invalid query below),
ALTER TABLE Person.Person
SET CHANGE_TRACKING = ON,
TRACK_COLUMNS_UPDATED = ON
I am always getting confused between when to use SET
, ENABLE
, or WITH
options
When are those options being used in TSQL? Is TSQL just being inconsistent?