Тёмный

148 How to download files from sftp server using batch file / command line / ssis / WinScp 

Learn SSIS
Подписаться 32 тыс.
Просмотров 2,6 тыс.
50% 1

open sftp://hp:test@192.168.0.199/ -hostkey="ssh-ed25519 255 SgbjGoUPs4JbLx4i5Vymcc7asasy1wpf/awTFcfWZvQ"
echo Connected !
get "C:/Data to Load/*.csv" "D:\Files\" -delete
echo Download Completed !
How to download files from sftp server using batch file
drive.google.com/drive/folder...
SSIS Tutorials: • SSIS Tutorials
SSIS real time scenarios examples: • SSIS real time scenari...
SSIS Interview questions and answers: • SSIS Interview questio...
How to download files from SFTP server using batch file?
Download SFTP file using SSIS package
How to get file from SFTP to local directory using bat file
Want to automate download of files from Sftp to local
How do I download all files from SFTP server?
Happy Learning.
If you have any questions or suggestions please comment on the video or write to me at “aqil33@gmail.com”

Наука

Опубликовано:

 

21 янв 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@sreylethtimmer6540
@sreylethtimmer6540 3 месяца назад
Good tutorial! Thank you for creating this video.
@learnssis
@learnssis 3 месяца назад
Thank you Srey Leth.
@user-df1kb7th3v
@user-df1kb7th3v 5 месяцев назад
Excellent explanation as usual
@learnssis
@learnssis 3 месяца назад
Thank you.
@liujianyang
@liujianyang 4 месяца назад
Thank you for the great tutorial. If my SFTP folder name changes daily as format YYYYMMDD, how do I achieve this? In the .bat command or SSIS?
@learnssis
@learnssis 4 месяца назад
There are 2 options here. 1. You can generate the bat command using the script task using C#. You can use the variable to get the current date in YYYYMMDD format and accordingly use that variable to concatenate the folder path. I would suggest you to take help from chatgpt and ask it to give you the C# code to do the same. Give it the static batch file command and ask to make the path dynamic with current date time and ask to write a C# script to produce that script. 2. You can use the variable in the batch command to get the current date. However I have not tried it before but you can try and here as well see if chatgpt can help to write the script for you. stackoverflow.com/questions/10945572/windows-batch-formatted-date-into-variable
@liujianyang
@liujianyang 4 месяца назад
@@learnssisThank you for explanation. I couldn't figure out how to inject variable into the bat command as it's not valid with SFTP connection string. C # code also requires third party library to code. I managed to get a plugin for SSIS which allows SFTP connection and special File Transfer Task which resolves it. Thanks again for your kind help.
@sumitahirwar2922
@sumitahirwar2922 4 месяца назад
Thanks sir 🎉, your video is very helpful. Suppose instead of D:/files download path can I make that dynamic . Consider a case where i need to download the sftp files on year_month folder in each month the folder is changing... How I can do that?
@learnssis
@learnssis 4 месяца назад
For that scenario you would need to create the batch dynamically using C# code.
@sumitahirwar2922
@sumitahirwar2922 4 месяца назад
@@learnssis thanks Sir ❤
@TKJ
@TKJ 27 дней назад
1. Delete file work on visual studio but after deployment it is not working. I gave folder permission as SQL Account but folder permission don't have server agent name to give permission. 2. Using .bat can we overwrite the file ? Instead of delete
@learnssis
@learnssis 27 дней назад
1. I am not sure here which account can be used in sql agent job to execute the ssis package as it will need to login to sftp server and delete the file from sftp server. Can you take a look at this url ? They are calling .batch file directly from the sql agent job www.mssqltips.com/sqlservertip/6285/automate-sftp-file-transfer-with-sql-server-agent-and-winscp/ 2. Do you mean overwrite file at sftp server ? I don't think we can overwrite file at sftp server.
@TKJ
@TKJ 27 дней назад
I want to download file by using bat file. But istaead of delete can we pverwrite destination folder file after download? Using bat file
@learnssis
@learnssis 27 дней назад
Is it not overwriting the existing file in the destination folder ? I think it should overwrite the file in the local folder.
@TKJ
@TKJ 27 дней назад
@@learnssis I have checked but .bat file unable to overwrite existing file. Can you please check and confirm
@learnssis
@learnssis 27 дней назад
@@TKJ Can you add -overwrite in the end of this line and see if it works. get "C:/Data to Load/*.csv" "D:\Files\" -delete -overwrite
@TKJ
@TKJ 27 дней назад
@@learnssis thanks I'll check
@user-mp1jn8vv3f
@user-mp1jn8vv3f 10 дней назад
I have successfully deployed the project in sql server however its not running under sql server agent showing the error 1.Winscp.exe is not in path when i chose the option File system 2.When I am selecting the SSIS catlogue it showing The certificate chain was issued by an authority that is not trusted
@learnssis
@learnssis 10 дней назад
Winscp should be installed on the server on which you are deploying your ssis package. Winscp.exe file should present at the correct location on server whatever location is given in the Execute process task.
@user-mp1jn8vv3f
@user-mp1jn8vv3f 9 дней назад
Winscp is installed on the server and also the file location is correct
@user-mp1jn8vv3f
@user-mp1jn8vv3f 8 дней назад
Hi Sir could you create one video on,How to run this job under SQL server agent
@learnssis
@learnssis 8 дней назад
@@user-mp1jn8vv3f There is no different way of scheduling this under sql agent job. You might be getting the errors because of permissions issue as the owner of sql agent service might not have proper access either on local or on sftp. Try to schedule this from windows task scheduler using your own account and see if that works, if it works then it might be permissions issue ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-w269R8gd_co.html
@user-mp1jn8vv3f
@user-mp1jn8vv3f 8 дней назад
Yes, It's working under task scheduler.
@fakergamers3219
@fakergamers3219 Месяц назад
Hi bro tyvm for your vid.. but i wanna try to make condition to download file if the file exist in sftp folder.. i try to use if exist command but the log return :Unknown command ‘if’
@learnssis
@learnssis Месяц назад
Sorry not sure how to do this with command line, but we can do this using C# ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2HdpMMPMo1A.html
@santhoshsomu6711
@santhoshsomu6711 5 месяцев назад
Hi Brother, I have the below scenario I am loading 2 Excel files, 2 excel files have different columns Passing these Excel files to procedures, Procedures will load data from Excel to tables. I am using For each loop container to pick the files. After loading these two files only I have to execute one final procedure How can I achieve this? After one file loading also it is executing final procedure
@learnssis
@learnssis 5 месяцев назад
Here there are few things. If you are trying to import the 2 excel files and they have different columns then they can't be imported using foreach loop container because a data flow task is very schema specific and it can't import the 2 excel files if they have different columns. Here you have 2 options 1. Use 2 data flow task, in first data flow task import first excel file. In second data flow task, import second excel file to sql server table. Now take an execute sql task and then execute the sp from the execute sql task. So you will have 3 tasks, and they will run in sequence, data flow task1, data flow task2 and execute sql task. 2. Another option is that you can use 2 foreach loop container, and in the first foreach loop container you can import 1 file. And in second foreach loop container you can import second file. So initially, first foreach loop container will be executed and then second foreach loop container will be executed, and then the execute sql task will be executed.
@santhoshsomu6711
@santhoshsomu6711 5 месяцев назад
@@learnssis I have to pass an Excel file as input to the stored procedure, the stored procedure will load the data into a table using the open rowset method. Here we are not using a Data flow task. I am using execute SQL task
@learnssis
@learnssis 5 месяцев назад
@@santhoshsomu6711Sorry I don't know if we can import the excel file to the sql server table. Did you tried importing the excel file to sql server table ? I know we can import the csv file to sql server table using sql query, but I am not sure if we can import the excel file to sql server table using sql query. Can you ask chatgpt if we can do or google it ?
@santhoshsomu6711
@santhoshsomu6711 5 месяцев назад
@@learnssis Yes we can import the excel file to sql server table using Open row set method. We are using that.
@learnssis
@learnssis 5 месяцев назад
Okay, I have explained in my previous reply that how we can do that using ssis, however I am not sure how we can achieve the same using sql query.
@shubhabhargava3520
@shubhabhargava3520 4 месяца назад
Hi I am trying to run the execute process task but getting below error , I am running via winscp , I am executing this task via admin account which having all the privilege Could you please help me 2024-02-18 16:00:53.638 (EOSError) System Error. Code: 5. * 2024-02-18 16:00:53.638 Access is denied . 2024-02-18 16:00:53.638 Asking user: . 2024-02-18 16:00:53.638 Can't create file 'C:\Program Files (x86)\WinSCP\Drive_***********.csv.filepart'. ("System Error. Code: 5.
@learnssis
@learnssis 4 месяца назад
If I look at the error message so it is saying "Access is denied". It seems like it is unable to create the file locally. Can you try give the download location in another folder, maybe in D drive, E drive or at least in another folder ?
Далее
05 Load only new files in SSIS
13:44
Просмотров 31 тыс.
3M❤️ #thankyou #shorts
00:14
Просмотров 8 млн
Should You Install Software Using .EXE or .MSI ?
10:15
Просмотров 529 тыс.
SSH, SCP, SFTP and FileZilla
17:49
Просмотров 27 тыс.
131 How to add a logging to SSIS package?
25:42
Просмотров 6 тыс.
Automate your job with Python
6:07
Просмотров 375 тыс.
S-Pen в Samsung достоин Золота #Shorts
0:38
Подключил AirPods к Xbox
0:45
Просмотров 23 тыс.