 Hey guys, welcome to SSU Tech, so see on this side and this is continuation of SSIS tutorial. So today we are going to discuss about row sampling and percentage sampling transformation. So let's start. So what is row sampling and what is percentage sampling? So these transformation in SSIS will take whole data from the source and it will randomly extract the selected number of rows from it. Next is it will return two outputs, one from the selected data and other from the unselected data. Like we have 1000 rows in our table and we want to extract only 5 rows from that. So we will return two outputs, first will return only 5 rows and second will return 995 rows. Next is in row and persistence sampling, it will block the source table and provide the random sample. So it's fully blocking transformation and it is used only for the testing purpose. And we have also an option to fix the random sample on every execution by checking the random seek option. And this is useful if the source data is not already be used. Like we have flat file source and it has a millions of records and we want to extract only 1000 records to verify the data. So there is no need to load that data in our table. We can use row sampling or percentage sampling transformation and then we can extract only selected data according to the requirement. So next is what are the difference between row sampling and percentage sampling? In row sampling transformation, we can set how many number of rows we want for sampling. And in percentage sampling, we can set the percentage of source data, how many percentage number of rows we want for the sample. So this is the only difference between row sampling and percentage sampling. So let's develop a practice where we can understand about row sampling and percentage sampling. So here we need to add one more practice. Then we can rename this with row sampling. Then we can use data flow task inside the control flow panel. Then double click on this data flow task. So inside this data flow panel, we can set our source transformation and destination. So our source is already be source as we can see in our SSMS. We have a sampling table and it has 1000 records. So we want to extract only 5 records from this table for our sampling. Let's configure our source. Double click on this already be source. Then we can set up our already be connection manager. As we have already made the connection, so I am going to use that one. Then we can select our table. So this is our sampling table. Now go to one columns. So we want to extract all the column. Click on it. So we have done our source. Now we need to configure our transformation. A row sampling transformation is available inside this other transformations. So we can drag and drop this row sampling transformation and then we can connect with source. Once we connect with source, then we can double click on this row sampling transformation. Here we can specify the number of rows. So we want 5 rows, so we can set up 5. Then we can see sample output name. This is our sample output name. It will return only 5 rows. Second, unselected output name. So in unselected output name, we will get 995 rows. Then go to one columns. So we want all the columns click on it. So we have done our row sampling. Now we need to configure our destination. So we don't want to load data in any destination. So we can use multicast. Test our data. Next week. Here as we can see we have two outputs. So we want to see selected sampling output. Click on open. Now we can use one more multicast. And now we can configure our unselected output. Then we can enable data. Now we can execute our practice. So selected sample, we will get only 5 rows. As we can see, we are getting only 5 rows. In our unselected output, we are getting 995 rows. On every execution, we will get the different data. As we can see, SO number 223 is our first. And then we can execute one more time. Then we can check. Our data will be changed. So our data has been changed. So now we can fix this output. By selecting a random C function. Click on OK. Now I am going to execute our practice. So we can see 995 is our first. Now I am going to execute one more time. It is going to return the same record. This is for row sampling. And we can set up our percentage sampling aspect. So how we can set up? I am going to disable this data pro task. Then I am going to use one more data pro task. And this is for percentage sampling. So double click on this. Here we need to set up our source. Transformation and destination. Our source is already the source. So we can drag and drop already the source. And then we can configure. Here we have already made the connection. I am going to select the table. This is our table. Click on OK. Now we need to select percentage sampling. So we can drag and drop and connect with our source. Now double click on this percentage sampling. So here we can see percentage of row. So if we are getting 1000 rows from our source. And we want to display only 10 rows. So we can set our percentage wheel to 1. Here again we have option to fix our random sample. So on every execution it will look in the same record. Now I am not going to load this data in my destination. So we can use multicast. This is for selected random sample. And this is for our product. So here we have selected. Click on OK. And this is for our product. Then we can enable data over. And now I am going to execute the status. Once I execute the status then we can see. We are getting 12 rows. And here we are getting 988 rows. So it will return the approximate 1% record from the 1000. And it will stop the status. I hope you have understood how we can use a row sample and how we can use percentage sampling according to our requirement. So in real-time scenario this is used for the testing purpose. If we have our source except for ADP source then we can use this transformation to fix the random record for our testing purpose. Thank you so much for watching this video. If you like this video please subscribe our channel to get many more videos. And press the like button so you will get the notification of our newly uploaded videos. Thank you so much.