 Hello, welcome to SS Unitech, so still decide and this is continuation of SSIS tutorial. So today we gonna discuss about how we can load data into Excel file from our database as I am using SQL Server. So we will use SQL Server and we will load data from SQL Server table to Excel. If you haven't watched previous video of this video series then I would strongly recommend to watch that video where you can understand how we can load data into database from Excel file. So here we will understand how we can load data into Excel file from database. So again we will face two type of scenarios. In our first scenario as you can see database table contains nwarecat data type for string data. As we can see in our first table we have four columns, first is ID, name, date of birth and salary. So we have four columns. In our second column as we can see from name we have nwarecat data type. So we want to load data from this table to our Excel file. We have six rows so these six rows should be inserted in our Excel file. So how we can do this? First of all we have to use a data flow task inside the control flow panel because we are dealing with movement of data and then move to data flow panel. Inside data flow panel we have to use OLEDB source from where we want to get the data and then Excel destination where we want to load the data. So let's move to SSGT to create the package. We want to create a new package, right click on this SSIS package then new SSIS package. Now I want to rename this package from database to Excel and this is for nwarecat. So this is our package name. So inside control flow panel we have to use data flow task. So we can drag and drop this data flow task. And once we double click on this it will directly move to data flow panel. So inside data flow panel we have to use OLEDB source where we want to get the data. So we can drag and drop this OLEDB source. Next we need to make the connection with our database. So double click on this OLEDB source then we can see it will ask for OLEDB connection manager. So click on new. We have already connection. I want to delete this connection and create a new one. Once we click on new then connection manager window will be open. And inside we need to select our server name. So we can select our server name. So this is our server name we can select. I am using window authentication. Then we need to select the database by which we want to connect. So we want to connect with SSIS test. Now we can check our connection. Connection succeed. Click on OK. So here we need to select the table. So this is our table. Employee data. Destination nwarecat. Go to on columns. As we can see ID, name, date of birth and cell D. So we have all the columns. Click on OK. So we have done our source part. Now we need to configure our destination. So we want to load data in our Excel destination. So we need to drag and drop this Excel destination and connect. Now double click on this Excel destination. Then it will ask for Excel connection manager. So we need to select our Excel connection manager. As we don't have any Excel connection manager at yet. So we need to create a new one. Now we can browse. And this is our destination. Go to Excel and EMP data nwarecat. Now we can click on open. Once we click on open. So here we can see our first row has column names. Then click on OK. Once we click on OK, then it will ask for seed name. So here we don't have any seed because our Excel file is not available at yet. So we want to create a seed. We can click on new. As we can see, create table Excel destination. So it will create a seed. We can click on OK. So once we click on OK, then we can see Excel destination seed will be available in our Excel file. So we can select go to on mapping. So in mapping, as we can see ID, name, date of birth and cell D. All these columns have been mapped successfully. So we can click on OK. Now we need to execute our package. As we can see, six rows should be inserted in our Excel file. So go to on Excel file. So this is our Excel file we can open. And we can see we are getting six rows. So we have six rows. And our first row should be column names. So this is our first scenario. So this is our second scenario. As we can see, database table contains wirecard data type for string data. So here, if we want to load data from database to Excel file and our table columns contain wirecard data type, then it will not be mapped successfully. And our package will not be succeed until unless we will not use data conversion. So let's see stars. You need to create one more package. Click on new SSIS package. And this time we need to renew with database to Excel and wirecard. So again, we need to use a Dataflow task inside control flow panel. So we can drag and drop this Dataflow task. Once we double click on this, it will directly move to Dataflow panel. Inside Dataflow panel, we need to configure our package. So here we want to select our source. So our source is OLLB source because we want to get the data from SQL server table. Now we can make our connection and I want to delete this and create a new one. We can select our server name. So this is our server name. Now we need to select our database name. So database name is SSIS test. Now we can check our connection. Connection succeed. Click on OK. Again OK and again OK. So here we need to select our table from which we want to get the data. So we want to get the data from this wirecard table. So we want all the columns and click on OK. So as we can see in our second table, we have wirecard data type for name. So we have selected this table and we have 20 records on this table. So these 20 records should be inserted in our Excel file. So here we need to select our destination. So our destination should be Excel destination. So we can drag and drop this Excel destination and need to map. Now we need to make connection for this Excel destination. So we need to select file. I want to rename with wirecard. Now click on open and OK. Here we don't have any seat at yet. So create a new seat, click on OK. Again OK and our seat has been created. Now go to on mapping. So inside mapping we can see our mapping succeed. So click on OK. So here we can see our destination has reflected an error. So what is error? The column name cannot be converted between unicode and non-unicode string data type. So we have to use data conversion to convert non-unicode data types to unicode data type. So we have to use data conversion. So drag and drop this data conversion and map double click on this data conversion. Then we can see our name. We can select name and we can rename our output alias name with name new. Then we can see our data type currently we are having string data type. So we want to convert this string data type to unicode string. Then click on OK. Now we need to map with our destination. Now go to on mapping. So as we can see we want to delete our existing mapping with name and map with new column which is name new. Now click on OK. As we can see error has been gone. Now we can execute our practice. So once we execute our practice so 20 rows should be inserted in our Excel file. So go to on Excel file as we can see this is our Excel file. So we are having 20 rows. So normally these two types of scenarios will be faced when we want to load data into Excel file from database. So I hope you have understand how we can load data into Excel file from database. If you like this video please subscribe our channel to get many more videos and please share to others. Thank you so much for watching.