Can we add new columns to existing type 2 (slowly changing) table ?
Asked
Active
Viewed 655 times
0
-
`alter table add column`. – Gordon Linoff Jan 25 '20 at 18:17
-
@Gordon i dont think the OP is asking to how to add but the possibility that after adding a column is it still scd2 – Himanshu Jan 25 '20 at 18:19
-
@HimanshuAhuja . . . I would say the question is quite unclear and incomplete. I stand by the answer in my first comment. – Gordon Linoff Jan 25 '20 at 18:46
-
Umm fair enough gordon.. but the reason i said was coz the OP's query includes Scd2 – Himanshu Jan 25 '20 at 18:56
-
@gordon .. sorry for the confusion.. my question was more on how does it effect the current data as the surrogate key changes when a new column is added.. – user3590303 Jan 27 '20 at 17:14
1 Answers
0
Yes, you could because the updation of data to a new row would still be based on surrogate key.
So, still your data would be updated to a new row in case of redundant with a same surrogate key version even if u alter the table with a new column

Himanshu
- 3,830
- 2
- 10
- 29
-
Dont you think the definition of surrogate key will change.. and how do you backfill data when a new column is added in SCD2 .. what happens to the existing data – user3590303 Jan 27 '20 at 17:12
-
Not really the surrogate key will change the behaviour but it will change its value depending upon the data as it comes. – Himanshu Jan 27 '20 at 18:24