Using WinSCP to insert a LS lookup into a SQL temp table

Advertisement

lairdmcbride2
Guest

Using WinSCP to insert a LS lookup into a SQL temp table

The below command works . .we think . . but the table does not get fed.


select @cmd = '"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script=' + @workdir + @workfilename

create table #a (id int identity(1,1), s varchar(1000))
insert #a
exec master..xp_cmdshell @cmd


and in the work file is this. .


open sftp://MyUN:UnHackablePW@sftpSite.basics.net
ls /users/ftpuic/Time/
quit

Reply with quote

Advertisement

lairdmcbride2
Guest

Re: Using WinSCP to insert a LS lookup into a SQL temp table

lairdmcbride2 wrote:

The below command works . .we think . . but the table does not get fed.


select @cmd = '"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script=' + @workdir + @workfilename

create table #a (id int identity(1,1), s varchar(1000))
insert #a
exec master..xp_cmdshell @cmd


and in the work file is this. .


open sftp://MyUN:UnHackablePW@sftpSite.basics.net
ls /users/ftpuic/Time/
quit


This code works perfectly with the windows internal ftp.exe application. . . but fails with WinSCP . . .my sad. . .

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,531
Location:
Prague, Czechia

Re: Using WinSCP to insert a LS lookup into a SQL temp table

What does the code do? Does it insert a console output of an application to an SQL table?

The winscp.exe is not a console application (like ftp.exe) is). It does not have any output that could be collected. You probably need to use winscp.com.

See https://winscp.net/eng/docs/executables

Reply with quote

Advertisement

You can post new topics in this forum