Scenario:
In this blog post we are going to learn how to read the file name from a Folder and Sub Folders and insert into a SQL Server Table. This can be helpful for Audit and to know how many files we have in folders.
Solution:
We will be using For-each loop container to get the files information. Let's start step by step
Step 1:
To save the file name we need to have a SQL Server table. Let's create a SQL Server table by using below script.
CREATE TABLE dbo.FileInformation ( FileID INT IDENTITY(1, 1), FileName VARCHAR(250) )
Step 2:
Create an SSIS Package by using BIDS or SSDT. Create a variable as shown below that is holding your files and also have sub folders with files.
Fig 1: Create FolderPath variable in SSIS Package
FileNamewithPath variable will be used in Foreach Loop Container to hold the value of file name with path that we will insert into our SQL Server table.
Step 3:
Drag For-each loop container from SSIS Toolbox on Control Flow Pane and configure as shown below. If you are only interested to save file name then use Name only and if you are interested to save file name with extension then use Name and Extension. As I want to save file name with folder , I have chosen Fully qualified in #5.
Fig 2: Configure Foreachloop Container to read the file names with path
Map the value read by Foreach loop container to FileNamewithPath varible.
Fig 3: Map the value to Variable in Foreach loop container
Step 4:
Create OLE DB Connection to the database where you have created dbo.FileName table.
Step 5:
As now we can read the file name with path by using Foreach loop and values will be saved in variable for each iteration , we can save the value of variable in our SQL Server Table. To save the variable value in SQL Server Table, we can use Execute SQL Task. Bring the Execute SQL Task inside the Foreach Loop container and configure as shown below.
Fig 4: Configure Execute SQL Task to insert variable value in SQL Server Table in SSIS Package
Map the variable to Execute SQL Task insert statement.
Fig 5: Map variable in Execute SQL Task in SSIS Package
Output:
Our package is ready. Let's run our SSIS Package and see if the file names are saved in SQL Server table from folder/s.
Fig 6: SSIS Package to load file names from folder/s in a SQL Server Table
Output from SQL Server Table
Fig 7: File Names in SQL Server table stored by SSIS Package
As we can see that the file names with folder information is successfully inserted in SQL Server table.
Video Tutorial for this post
ReplyDeleteThank you so much for sharing this great blog.Very inspiring and helpful too.
LoadRunner Training in Chennai
Loadrunner Training in Porur
Loadrunner Training in T Nagar
QTP Training in Chennai
QTP Course in Chennai
clinical sas training in chennai
SAS Course in Chennai
LoadRunner Training in Chennai
IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes. IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble.Final Year Projects for CSE
DeleteSpring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining .
Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai
The Angular Training covers a wide range of topics including Angular Directives, Angular Services, and Angular programmability.Angular Training
ReplyDeleteThis is really too useful and have more ideas and keep sharing many techniques. Eagerly waiting for your new blog keep doing more.
web designing training in chennai
Development courses in Chennai
ccna course in Chennai
Best PHP training in chennai
ReactJS Training in Chennai
Web Designing Course in chennai
Web designing training in chennai
This comment has been removed by the author.
ReplyDeleteIt is a very presentable post and looks like a post. Recently I am seeing your blog, this is the great concept good explanation. Thank you for your efforts.
ReplyDeleteOracle DBA Training in Chennai
Oracle DBA Course in Chennai
Spark Training in Chennai
Oracle Training in Chennai
Linux Training in Chennai
Social Media Marketing Courses in Chennai
Primavera Training in Chennai
Unix Training in Chennai
Power BI Training in Chennai
Tableau Training in Chennai
คาสิโนออนไลน์ที่น่าเชื่อถือและมีความเป็นมืออาชีพที่สุดในตอนนี้
ReplyDeleteโปรโมชั่นGclub ของทางทีมงานตอนนี้แจกฟรีโบนัส 50%
เพียงแค่คุณสมัคร สล็อตออนไลน์ กับทางทีมงานของเราเพียงเท่านั้น
ร่วมมาเป็นส่วนหนึ่งกับเว็บไซต์คาสิโนออนไลน์ของเราได้เลยค่ะ
สมัครสล็อตออนไลน์ >>> Goldenslot
สนใจร่วมสนุกกับ คาสิโนออนไลน์ คลิ๊กได้เลย
มีทั้งคาสิโนออนไลน์ หวยออนไลน์ ฟุตบอลออนไลน์ สล็อตออนไลน์ และอื่นๆอีกมากมาย
Thanks for sharing this blog...
ReplyDeleteweb designing course in chennai with placement
php developer training institute in chennai
magento training institute in chennai
Really informative blog for all people. Thanks for sharing it.
ReplyDeleteSpoken English Classes in Chennai
Spoken English Course in Chennai
german classes
Best IELTS Coaching in Chennai
learn Japanese in Chennai
TOEFL Coaching Centres in Chennai
Spoken English Classes in Anna Nagar
Spoken English Classes in Tnagar
Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
ReplyDeletemobile application development course | mobile app development training | mobile application development training online
"web designing classes in chennai | Web Designing courses in Chennai "
Web Designing Training and Placement | Best Institute for Web Designing
Web Designing and Development Course | Web Designing Training in Chennai
mobile application development course | mobile app development training
mobile application development training online | mobile app development course
mobile application development course | learn mobile application development
app development training | mobile application development training
mobile app development course online | online mobile application development
Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
ReplyDeleteweb designing classes in chennai | web designing training institute in chennai
web designing and development course in chennai | web designing courses in Chennai
best institute for web designing in chennai | web designing course with placement in chennai
Web Designing Class
web designing course
best institute for web designing
I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
ReplyDeleteweb designer courses in chennai | best institute for web designing Classes in Chennai
web designing courses in chennai | web designing institute in chennai | web designing training institute in chennai
web designing training in chennai | web design and development institute
web designing classes in Chennai | web designer course in Chennai
web designingtraining course in chennai with placement | web designing and development Training course in chennai
Web Designing Institute in Chennai | Web Designing Training in Chennai
website design course | Web designing course in Chennai
The article is so informative. This is more helpful for our
ReplyDeletemagento training course in chennai
magento training institute in chennai
magento 2 training in chennai
magento development training
magento 2 course
magento developer training
Thanks for sharing.
This is a great inspiring article. I am pretty much pleased with your good work. You put really very helpful information. Keep it up. Keep blogging. Looking forward to reading your next post.
ReplyDeleteBest Wedding Photographers | Wedding Photographers in Rohini | Wedding Photographers in Pitampura | Wedding Photographers in Delhi
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteThanks...
web development company sydney
This article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention.WordPress Plugins
ReplyDeleteGreat Article. Thank you for sharing! Really an awesome post for every one.
ReplyDeleteDigital Marketing Course In Kolkata
Web Design Course In Kolkata
This was an excellent post and very good information provided, Thanks for sharing.
ReplyDeleteSoftware Testing Training in Chennai
Software Testing Institute in Chennai
Python Training in Bangalore
Hadoop Training in Coimbatore
Software Testing Course in Bangalore
Software Testing Course in Madurai
Software Testing Course in Bangalore
Software Testing Training Institute in Bangalore
Web designing Course in Bangalore
angular training in bangalore
Its a great pleasure reading this post. Want to share with another useful article
ReplyDeletehttps://cgifurniture.com/photorealistic-product-rendering-services-online-shopping/
Excellent information with unique content and it is very useful to know about the information based on blogs.
ReplyDeleteLaravel developer in California |
Shopify developer in California |
website agency in California |
Wordpress developer in USA |
Woocommerce developer in USA |
PHP developer in USA |
Nice article,i really admire after reading this blog. oracle training in chennai
ReplyDeleteI am incapable of reading articles online very often, but I’m happy I did today. It is very well written, and your points are well-expressed. I request you warmly, please, don’t ever stop writing. where to buy cbd
ReplyDeleteWhat a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. what is cbd vape oil
ReplyDeleteWonderful article. Fascinating to read. I love to read such an excellent article. Thanks! It has made my task more and extra easy. Keep rocking. cbd online
ReplyDeleteI have been checking out a few of your stories and i can state pretty good stuff. I will definitely bookmark your blog cbd cheap
ReplyDeleteEnsure you get your store out there. Find significant blog entries or become a confided in individual from a discussion applicable to your items. On the off chance that individuals don't have the foggiest idea about your store exists they can't accepting from it.besimple.com/
ReplyDeletevery interesting keep posting. cbd oil wholesale
ReplyDelete