 Hello, welcome to SSUnitech Social Decide and this is continuation of SSIH tutorial. So today we gonna discuss about slowly changing dimension. So this is another technique for incremental load. So let's start with slowly changing dimension. It is used to capture the information of incremental load. That is fine. Next here we need to take care first is fixed attribute then changing attribute and then historical attribute. In fixed attribute is used when we don't want change the data for any column. Like we have a customer table and we have customer id. So we don't want to change customer id for any transaction. So that would be our fixed attribute. Next is slowly changing dimension type 1. That is changing attribute. So it is used to overwrite our existing data with the new data. Hence it doesn't maintain any history. Like we have any column and we don't want to capture the history for that column. So we can select our scd type 1. That is our changing attribute. Next is scd type 2 that is our historical attribute. So it is used to maintain the history of any existing data along with the new data. We can maintain time period to get the active records or we can set any flag for any column which will indicate the active record. So going to ssdt let's have a look of sequence over table. So this is our customer table as we can see it has 3 columns. First is customer id then customer name then social security number. This is our destination table and in destination table we have extra column that is active. So active we have specified default value of this active column is 1. That is that record would be active. Let's move to ssdt. Let me create one more package. And call this package as slowly changing dimension that is fine. Now so here we need to use dataflow task then double click on this dataflow task. So in dataflow panel we want to get data from sequence over table. So we have to use oledb source. Not double click on this oledb source then oledb connection manager click on new that is fine. We can select and here we need to select our table. That is our ssd customer source table that is fine go to one columns and I am happy with all these columns click on ok. So we have done our source now we need to configure our slowly changing dimension. So we can drag and drop slowly changing dimension and then connect with oledb source. Now double click on this slowly changing dimension click on next then here we need to specify our destination connection. So in my case our source table and destination table both are present in ssuritech database. So we can use the same connection manager. In your case it may be present in same database or other databases. So we need to make our source connection manager separate and destination in separate. So we need to select our destination table. So this is our destination table and here first we need to take care one thing we need to select any column as business key. So this column value will not be going to change and we will look up on behalf of these values click on next. So here as we can see dimension column. So here we can read fixed attributes, changing attributes and historical attribute. So we need to select the column. So as we can see social security number it is our fixed attribute it is not going to change. In our customer name we can set as changing attribute at this time. So once our package will be executed then our existing record will be replaced by our new record. So click on next that is fine. So here it will ensure that if we will detect any changes in our fixed attribute then our package will be filled. So I am happy with this click on next and again next then finish our package. Then we can see it will automatically generate our destinations. First is OLEDB destination for insert values and then we are having OLEDB command for our update values. If we will delete any data from our source then it will not going to handle by using scroll is changing dimension. Go to on SSMS. So this is our destination table and we are not having any data right now. In our source we have six rows. So once our package will be executed then these six rows should be inserted in our destination. Now click on start. That is fine. Six rows goes to new output and should be inserted in our table. Stop this package. Go to on SSMS and go to on destination. Now we can refresh. So we can see we are having six rows. Now I want to make some changes on this customer name. So this is how we are replaced by how it fight. Once our package will be executed then how it would be replaced by how it fight. So let me execute this package. So as we can see one rows goes to the update. So it should be updated. Now we can go to on sico soar and refresh this. So we can see how it fight. So this is our changing dimension. Next is we want capture the history data. So double click on this changing dimension. Now click on new. That is fine and here we need to replace this changing attribute with historical attribute. Now click on next again next. So here as we can see we have two options to capture the active records. First we can capture by any column which reflect the flag and then in our second we can select our start date and end date. So in this example I am going to use flag. In our next example we will handle how we can deal with start date and end date. So here we want to capture information in active column that is fine and value when current then that is true when expired then false that is fine. Click on next again next and finish. So our package will be changed. So SCD will automatically change the package according to we set up. So here as we can see it is changed. Now we can save our package. Now go to on ssms, go to on source and here I used to change this with sundasing. So once our package will be executed so existing id4 active column will be false and it will insert a new record. So go to on ssdt and execute our package. So package executed successfully as we can see one row is inserted and inside this already we command we have one row. Stop this package, go to on ssms, refresh our destination table. So as we can see id4 our old record is false and new record is inserted. That is fine. Go to on ssdt and this time I would like to handle with start date and end date. So I have created one more table that is our SCD type 2 destination table and here we are having customer id, customer name and social security number which are available in our source table and we are having from date and to date. That would capture the active record. So go to on ssdt, then click on this slowly changing dimension. Click on next and here I want to change our destination with SCD type 2 and that is vinesky that is fine click on next that is also fine click on next again next. Here we need to select our second option. So this is our from date and this is our to date. So here we need to select a system variable that would be contain the information of date that is creation date click on next, next and finish. So our package will be changed that is fine save our package. So initially as we can see we don't have any data in this table. So let me execute this package. So all six rows should be inserted in our destination table. Stop this package and go to on ssms then refresh this table. So as we can see to date is null for all these cases it means these are the active records. Let me modify some record on the source. So Deepak would be Deepak Kumar that is fine and Rajesh would be Rajesh Gupta that is also fine. So once our package will be executed then these records will be in active record and five and six will be inserted one more time with our new record. So go to on ssdt let me execute this package. So as we can see two rows so stop this package and go to on ssms. Let me refresh this table. So as we can see five and six. So this is our inactive record and here we are having to date as null. So these are our active records. So I hope you have understand how we can use slowly changing dimension. Here we can able to incremental load with insert and update only. So thank you so much for watching this video. If you like this video please subscribe our channel to get many more videos. Don't forget to press the bell icon to get the notification of our newly uploaded videos. Thank you so much.