This project is read-only.
1
Vote

History file hard coded for SCD1 pattern

description

Original code incorrectly hardcodes HistoryTableName, viz.
Private Function BuildSCD1Insert(ByVal cnStr As String, ByVal tableName As String, ByVal LineageId As String) As String
...
    insertSql = " INSERT " + tableName + "History ( " + columnList + " ) SELECT " + columnList + " FROM " + tableName _
        + " WHERE VersionId = 1 AND LineageId = " + LineageId
...
End Function
 
Fixing is easy, viz.
Private Function BuildSCD1Insert(ByVal cnStr As String, ByVal historyTableName As String, ByVal tableName As String, ByVal LineageId As String) As String
...
    insertSql = " INSERT " + historyTableName + " ( " + columnList + " ) SELECT " + columnList + " FROM " + tableName _
        + " WHERE VersionId = 1 AND LineageId = " + LineageId
...
End Function

comments