Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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
lairdmcbride2

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. . .
lairdmcbride2

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