 Hey guys, welcome to SSUnitech, so still decide and this is continuation of SSIS tutorial. So today we gonna discuss about dynamic connection manager. So what is dynamic connection manager? So dynamic connection manager will be created automatically. Like we can see we have a scenario where we have SQL server table and we want to load the data from SQL server table to our flat file destination. And here we can see we have flat file name with sale underscore 2018 which is our year, then month, then date, then hour and then minute. So we have this flat file. Once we run this flat file on 1054 our flat file name should be 10 underscore 54.txt file. When our time will be changed then we need to run our package then it will automatically generate a new file with the new date and time. So let's have a look of SQL server table. Now we need to execute, so as we can see it has total six column, cell order number, cell order date, customer ID, quantity, value and country. So go to on ssgt to implement the package. So here we need to create one more package, so right click on this SSIS package then new SSIS package. Then I want to rename this package with dynamic connection manager. Then we need to drag and drop data flow task. After that we need to double click on this data flow task. So it will directly move to data flow panel. Inside this data flow panel we need to configure our source. So our source is already be source so we need to drag and drop already be source. Then we need to load data in our flat file. This is our flat file destination. So we can drag and drop. Now we need to configure our source. So double click on this already be source. Here we need to select the connection manager. Click on new. Here we have already made the connection. So I want to use that one. So click on OK. Here we need to select the table. So our table is cell info table. So we can select and we can preview. So we can see we are getting the data. Now go to on columns. Now we want all the column then click on OK. So here we need to connect with destination. Now we need to configure our destination double click on this flat file destination. Then we need to select the flat file connection manager. So I need to click on new. Then we want create delimited file. We are OK with it. So click on OK. So here we need to select the file name. So we can browse and here we want to generate file with the name of sale. So we need to write sale then click on open columns name in the first data row. So we can check this checkbox go to on columns. So as we can see we are getting the all columns now click on OK then go to on mapping. So mapping succeed now click on OK. So once we run this package so it will generate a file with the name of sale. So after some time once we run this package again then it will not going to create one more file with date and time. So for that we need to create two variables. So go to on variables. So here I want to use for folder name. So this is our folder name data type should be string. So we can select a string. And then we need to specify the value. So this is our folder path. So we can copy and we need to paste that in our value and we can create one more variable with the name of file name and data type should be a string. So we can select string here I am not going to pass any hard code value. So we want to generate the file name at runtime. So go to on expressions we can click on this here in this expression we need to write some code. So first of all we need to write sale and here we can check. So we are getting the sale sale then underscore then we need to concatenate sign which is plus then we want to get date and time. So we can use get date for current date and time. This is our date time and sale underscore is our string. So we need to convert. So here we have to write dt underscore w str then we need to specify the size. So I want to use 100 now I need to evaluate. So once we evaluate then we can see we are getting the date and time. But we want to fit here then month then date hours and minutes. So I want to fetch only four characters from starting. So service string then we need to specify start value. So we want to start from one then how many character we want for character. So we can select four then close the bracket evaluate then we can see we are getting the data. Now we need to use underscore so we can again evaluate. So we are getting the year. Now we need to configure for month. So I am going to copy this code and then plus sign and paste that value this time we want to get the value from six and we want to get only two characters for month. So as we can see we are getting 12. Now again we need to specify our concatenate symbol which is plus then paste this code and this time we start from nine and we want to get only two characters for date. Now what one evaluate so we are getting zero four between this we need to use underscore. So we can specify underscore. Now we can evaluate so as we can see we are getting year month and date. Now we need to get our so again we need to use underscore. So this is underscore then I want to paste that value. So this time we want to start from 12 and we want only two characters. Now we can evaluate and we can see we are getting the value. This is for our now last time we need to use for minute. So underscore concatenate symbol then paste that value. So here we can see we are getting from 12 then we need to start from 15 and we need to use only two character so we can evaluate and we can see we are getting the minute as well. Now we need to use the file extension should be DHT file. Now we can evaluate and we are getting the value so we can OK. So here this is our file name and this is our folder name. So we have done it now we can save this practice and go to one flat file connection manager then we need to press F4 to get the properties. Inside this property we can see we have expressions. So click on this expression and here we have connection string. So in this connection string we need to go on expressions then here we have folder path. So we can drag and drop this folder path within expressions then we need to use concatenate symbol which is plus then we need to drag and drop this file name. Now we can click on evaluate. So this is our folder path inside this folder our flat file name should be this and this flat file would be generated. Now click on OK again OK. So as you can see time is 11.6 so I want to run this practice once we run this practice then our file should be generated with the time 11.6 go to one folder. So here we can see we are getting the file with 23 underscore 0.6 so this is our 11.6. So I want to stop this practice and again run this practice when our time will be changed. So as we can see time has been changed I want to run this practice one more time. So click on start. So new file should be generated go to one folder as we can see we got a new file. So this is our dynamic connection manager. So it will generate a new file on every execution if the time will be changed because it's dependent on time. So thank you so much for watching this video. If you like this video please subscribe our channel to get many more videos and don't forget to press the bell icon to get the notification of our newly updated videos. Thank you so much.