 Hello, welcome to SSC Unitec. My name is Suseen Singh and this is continuation of SSIS tutorial. So today we are going to discuss about how we can load data from FlatFile to our database. So let's start. So as we can see over here, first of all we have to use a Dataflow task inside this control flow in our first image. And in our second image we can see first of all we have to use a FlatFile source from where we want to get the data and then we have to use a ADB destination where we want to load the data. So this is our process which we have to follow. So let's move to SSGT. In our last video we have understand how we can start with SSGT. This is our package. First of all I am going to rename this package with FlatFile to database. So this is our first package FlatFile to database. So as we can see over here we have to use a Dataflow task. So this is our control flow and here we need to use Dataflow task. We can drag and drop this Dataflow task. And once we directly click on this Dataflow task it will directly move to Dataflow panel. In Dataflow panel we can see in our SSIS tool box we have option for other sources. When we expand this other sources then we can see we have FlatFile source. Then we can drag and drop this FlatFile source. So before going forward I would like to explain about connection managers. So what is connection managers? So connection managers are used to make the connection to connect with our source or destination. For example here we want to get the data from FlatFile and then we want to load that data in our SQL Server tables. So here we need to make two connections. First is for FlatFile source and second is for our OLEDB destinations. So before making connection let's have a look of FlatFile by which we want to get the data. So we have this text file. So here we can see it has comma separated values and it contains three columns. First is for ID, second name and then Dataflow. So here we need to load this data in our SQL Server table. So go to SQL Server Management Studio. So in SQL Server Management Studio we can see we have a table with FlatFile to database table. It contains three columns. First is ID, then name and then data output. Initially we don't have any data and we want to load data from our FlatFile which is available over here. We can see it has comma separated values and total eight rows is available over here. So we want to load this data in our SQL Server table. So I need to create a connection for FlatFile source. So double click on this FlatFile source and here we can see FlatFile connection manager. Initially we don't have any connection over here. So we have to make a new connection. So click on new. Once we click on new, then it will ask few things. First is file name. So we need to browse. As we can see FlatFile comma delimited source. We need to open. Then we need to go to on format. In format we can see we have three types of formats available in FlatFile. First is delimited, second is fixed width and last is ragged write. So FlatFile source contains three formats. First is delimited, second fixed width and then ragged write. In delimited we can see values will be delimited by any delimited like comma, pipeline or anything else. And in fixed width column size will be fixed and in ragged write column size also will be fixed. But what is the difference between fixed width and ragged write? The only difference between fixed width and ragged write last column value is variable in case of ragged write. Rest of the column value should be same but the last column value will be variable. So here I am going to load data from delimited file and delimited is comma. So go to columns column delimited is comma. So we can select comma from this dropdown. It has another option as well. So here we can see we are getting the data which is our label in our text file. But we do not want to load double quote which is available in our input. So how we can remove this double quote in our source? So go to on general and here we can see text qualifier. In text qualifier we need to specify that character. That character is double quote. So double quote specified over here. Now we need to go to on column and here we can see double quote is removed. If we want to remove any another character then we can specify. So now go to on advance. In advance we can specify the data types. So first is ID. ID should contain the value of integer. So we can convert this from our integer and now go to on name. Name contains the string and output column width is 50. It's fine to me. If we want to change this we can change by 100 or anything else. Then we can see in date of birth. Date of birth is also contains the string value. Now we don't want string value. We want to convert this string value to dead time. So now we can select dead time, time is time. That is fine to us and go to preview. It looks fine to us. Then we can click on OK. So here we have another option retain null values from the source as null values in the data flow. So what it mean? So when we check this checkbox then if we are getting any blank or zero length value from our source then it will be converted to null. As we can see preview over here then we can see our where ID is 8 then name value is blank. Once we checked this checkbox then we can preview then this blank will be replaced by null and once we load this data in our SQL Server table then we can see null will be loaded instead of blank. Now we can click on OK. We have done our source part. Now we need to make the connection for destination where we want to load the data. So we need to select OLEDB destination. So this is our OLEDB destination. Now we can see we have two pipelines over here. First is for this task will be completed successfully either for failure. So we want to pass this data from this flat file source to our destination. Now we need to make one more connection for this destination. Now once we double click on this then we can see it will ask for OLEDB connection manager. Now we need to create one more connection. I have already created the connection now I am going to delete these connections and create new one. So once we click on new it will open this window. It will ask for server name. Now we can select our server. So here we can see this is our server name and here we need to select the database name by which we want to connect. Then it's SSI status where we want to connect. Now we can check the connection. Connection succeed then we can click on OK. And then we need to click on. So connection has been made. Now we can enable to access the tables. So as we can see we can scroll down and we have flat file to database table. Go to on mapping. So mapping succeed because the input column names and output column names both are same. So it will be mapped automatically. Now click on OK and execute our package. So we can see 8 rows and our package completed way successful. We can stop this package and go to our SQL server. And we can execute our now we can see now we are getting the data and for ID 8 name value was blank in our flat file. So it has been removed by null. So I hope you have understand how we can load the data from flat file towards SQL server tables. If you like this video please subscribe our channel to get many more videos. Thank you so much for watching.