51 How to load only specific files from a folder in SSIS

  Рет қаралды 6,355

Learn SSIS

Learn SSIS

Күн бұрын

Пікірлер: 34
@geeseeoh
@geeseeoh 2 жыл бұрын
Thanks!
@learnssis
@learnssis 2 жыл бұрын
Thanks so much for your support. But honestly speaking you don't need to do this. I make the videos because I like doing this, I made this video because I found the question interesting. If you can just watch my videos that will be a good support, you don't need to pay anything. Anyway thanks for supporting.
@1217895
@1217895 Жыл бұрын
Hi Aqil, quick question - what if my connection to SQL server is via SQL Authentication and not Windows authentication? What would the connection string string connString = @"Server =DESKTOP-EKJ1P64\SQL2019; Database = Work; Trusted_Connection = True;"; be modified to?
@yusufkurniaromadhon7736
@yusufkurniaromadhon7736 2 жыл бұрын
Hi Aqil, thank you for the help with this video. I have a question, why my script task always throws error: "DTS Script Task has encountered an exception in user code... exception has been thrown by the target of an invocation" ? I've tried to change the "TargetServerVersion" but it didn't work. Thanks
@learnssis
@learnssis 2 жыл бұрын
Try to implement error handling in script task and it can log the actual error message may be to a flat file. You can take a look at this video where I have shown how to implement this. kzbin.info/www/bejne/qGiqo2anbt-LkLM
@abiramimurugan32
@abiramimurugan32 Жыл бұрын
Hi I need your suggestion in one of my scenario what I am facing now.In folder we have n number of CSV files in that I should give priority for particular input file(filename vl be in dynamic) in foreachloop container how should I achieve that?
@learnssis
@learnssis Жыл бұрын
What I would do is that I will use a foreach loop container with file enumerator and then inside foreach loop container I will use an execute sql task and in that I will insert the filename into a staging sql table along with a column like Priority or something. Now after the foreach loop container I will use an execute sql task and in that I will assign a number to the priority column based on an update statement, we can use row_number function to get a number and assign the number. Now I will use another execute sql task to select the files from the table according to priority and then will use another foreach loop container with ado enumerator to get the file name. Now inside the foreach loop container as you have the filename thus you can do anything with file like loading the file to sql server or something.
@abiramimurugan32
@abiramimurugan32 Жыл бұрын
Thank you for the solution.
@ofaolain
@ofaolain Жыл бұрын
Hi can you use a where clause when you select the file names from the table . I have tried but it still loads all the files that are in the table
@learnssis
@learnssis Жыл бұрын
Take a look at this example kzbin.info/www/bejne/iWG8nYlpf5erabc
@pavanarajuk445
@pavanarajuk445 2 жыл бұрын
Sir please do one video on performance tuning in ssis, sql server
@learnssis
@learnssis 2 жыл бұрын
Sure, will make a video on this topic as well.
@deepakj6717
@deepakj6717 2 жыл бұрын
Thank you very useful !! What if file contains current Date with file name i.e. UserInfo_17052022.CSV .. Date value gets changed everyday. If there are multiple files with same name then i want to load file which contains Maximum records.
@learnssis
@learnssis 2 жыл бұрын
Hi Deepak, if the file contains current date then we can just everything before the under score _ and check for that value in the List if that value exists in list then load the file. For your second scenario that if multiple files found with same name then we need to get the count of each file by using below query System.IO.File.ReadAllLines("path").Length And append this value to a list and then you can sort the list in descending order and just load the top file.
@aditipande
@aditipande 2 жыл бұрын
How to load several files from database to folders through ssis
@learnssis
@learnssis 2 жыл бұрын
Take a look at this video Aditi kzbin.info/www/bejne/f2jInmanm69jhJY
@hemareddy5296
@hemareddy5296 2 жыл бұрын
👌
@geeseeoh
@geeseeoh 2 жыл бұрын
Aqil, excelent video. Thanks for taking the time to answer my question. It simple and very concise. Looking forward to watching the rest of your videos. I hope you’re making a lot of money with your videos :).
@learnssis
@learnssis 2 жыл бұрын
No problem. I found your question interesting thus thought to make a video on this one. When I started creating the video then I found it more complex than I thought initially. As of now I am not earning a lot the views on the videos are not that good as you can see, but may be if you guys will support then in future I can earn more :)
@glennbabic5954
@glennbabic5954 2 жыл бұрын
@@learnssis In the script you don't need to load all the Filenames into a list and then search for a match. Initialize SSISFileName before then inside the while loop you can check for a match as you go and immediately return if success. In fact, loooing through entire FileNames table every file load is redundant and hinders performance. Surely there"s a more elegant way.
@learnssis
@learnssis 2 жыл бұрын
@@glennbabic5954 Yes you are correct. We are doing some unnecessary work here. Thanks for your suggestion.
@glennbabic5954
@glennbabic5954 2 жыл бұрын
@@learnssis I've always been a nasty nitpicker sorry. Thanks for your videos they teach me a lot and help me prepare for interviews!
@learnssis
@learnssis 2 жыл бұрын
@@glennbabic5954 You are awesome. We all can learn from each other. Keep watching.
@oguzolgun7609
@oguzolgun7609 2 жыл бұрын
Hi Aqil, thank you for this video. It almost answers my questions. I have another one, in a project I have multiple files in my source folder like below; orders_20230105_0700.csv orders_20230105_1000.csv orders_20230105_1300.csv I need to process the latest one then move it to the Process folder, and archive others directly to the Archive folder. I can manage the file moving part but I'm confused about this part; how can I get the latest file to process and how can I move others without any process? I saw your youtube channel yet, so if you have some videos about this I must have missed it. If you have time to answer me I would be glad. Thanks you
@learnssis
@learnssis 2 жыл бұрын
Thank you Oguz for your comment. I will try to make a video on the scenario you mentioned to import the data from most recent file and move the file to processed folder and then move rest of the files to the archive folder.
@oguzolgun7609
@oguzolgun7609 2 жыл бұрын
@@learnssis thank you so much, If I you think I can help you somewhere, please let me know. :)
@learnssis
@learnssis 2 жыл бұрын
@@oguzolgun7609 No problem its fine. The video should be uploaded in another 30 min but it will be unlisted however you can watch it from the link I will share.
@oguzolgun7609
@oguzolgun7609 2 жыл бұрын
@@learnssis you're amazing. thank you so much!
@learnssis
@learnssis 2 жыл бұрын
@@oguzolgun7609 Below is the link to the video kzbin.info/www/bejne/hWLbh5-Bpp2Wp7s
@VamsiKrishna-yp6ye
@VamsiKrishna-yp6ye 2 жыл бұрын
How to load recent files in a particular folder by using file time stamp.
@learnssis
@learnssis 2 жыл бұрын
Please take a look at this video, I am doing almost same thing here kzbin.info/www/bejne/qKW8mqWVZ7ifhq8
@VamsiKrishna-yp6ye
@VamsiKrishna-yp6ye 2 жыл бұрын
Tq sir
@1217895
@1217895 Жыл бұрын
Hi Aqil, quick question - what if my connection to SQL server is via SQL Authentication and not Windows authentication? What would the connection string string connString = @"Server =DESKTOP-EKJ1P64\SQL2019; Database = Work; Trusted_Connection = True;"; be modified to?
@learnssis
@learnssis Жыл бұрын
Take a look at this video kzbin.info/www/bejne/g4vJoZx7jq2oaas
52 Performance tuning in SSIS
9:44
Learn SSIS
Рет қаралды 5 М.
06 How do I archive files in SSIS
20:10
Learn SSIS
Рет қаралды 12 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
49 Load only the files those got modified today in SSIS
12:14
Learn SSIS
Рет қаралды 4,4 М.
160 How to rename all files from a folder using ssis
11:26
Learn SSIS
Рет қаралды 953
131 How to add a logging to SSIS package?
25:42
Learn SSIS
Рет қаралды 8 М.
05 Load only new files in SSIS
13:44
Learn SSIS
Рет қаралды 34 М.
130 How to read data from api in ssis
18:26
Learn SSIS
Рет қаралды 20 М.
SSIS Parameters and Environments
20:27
Tim Mitchell
Рет қаралды 89 М.
9 AI Tools You MUST Be Using in 2025.
17:53
Ishan Sharma
Рет қаралды 55 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН