July 20, 2010 at 9:08 am
What are my options if i cant use ssis?
I need to write a proc that can transfer files from/to sftp server.
July 20, 2010 at 11:17 am
Check out this website! I believe you can find a Secure FTP component for SSIS!
July 20, 2010 at 11:19 am
I have also use SFTP command line within xp_cmdshell to this also.
July 20, 2010 at 12:32 pm
I cant use SSIS,
how do i specify port 22 in xp_cmdshell ?
July 20, 2010 at 1:50 pm
if you are sending to an ip then xxx.xxx.xxx.xxx:port, I think you can do the same for a url just tack on the :port.
It has been awhile since I done this too.
July 20, 2010 at 2:34 pm
that didnt work for me,
all is get is :
idouputtmp
1Unknown host xxx.xxx.xxx.xxx:22.
2Invalid command.
3Invalid command.
4Interactive mode Off .
5Not connected.
6Not connected.
7Not connected.
8open xxx.xxx.xxx.xxx:22.
9user
10pass
11prompt
12binary
13cd /users/file.txt
14mput \file.txt
15quit
16NULL
July 20, 2010 at 3:05 pm
Is this for a system that you plan on, or currently sell? If so I'd recommend using a SQL Agent job with a CmdExec step that does this. Then use sp_start_job to kick odd the job to do the sftp. One of my vendor system review questions is do you use xp_cmdshell because it is a significant security risk, that's why it is disabled by default in 2005/2008.
The other thing would be to use a certificate to sign your stored procedure and create a certificate login that is added to the sysadmin role allowing your stored procedure to call sp_configure and RECONFGURE to turn xp_cmdshell on and then back off. If you do this make sure you drop the password on the certificate, preventing it from being reused for other elevated purposes.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]
July 21, 2010 at 7:38 am
I was going with xp_cmdshell since i didnt know any better, now i do :).
Can you collaborate on how to do sftp with CmdExec ?
July 21, 2010 at 7:44 am
The same way you would from a batch file or from a command prompt. Generally you can create a batch file to test your commands and develop your automation by calling that file from the command line. Then to create the job copy the contents of the batch file into the CmdExec job step, or just call the batch file from the job step.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]
July 21, 2010 at 8:31 am
That could work, however how would i connect to sftp on port 22 ?
July 21, 2010 at 12:42 pm
putty requires host key verification, is there anything else that i could use?
July 23, 2010 at 1:42 pm
Once again i cant use SSIS.
I've decided to go with WINSCP and have the following challenge:
single step job executes:
----------------------------------------------------------
\\app\WinSCP.exe /console /script=\\app\config.ul
----------------------------------------------------------
config.ul is written as:
----------------------------------------------------------
option batch on
option confirm off
open sftp://user:pass@ftp.net.com -hostkey="ssh-rsa 1024 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00"
option transfer binary
put \\app\files\file.txt
close
exit
----------------------------------------------------------
and i get the following output:
----------------------------------------------------------
Executed as user: DOMAIN\USER. The step did not generate any output. Process Exit Code 1. The step failed.
----------------------------------------------------------
File is partly transferred, how do i increase time???
help...
July 23, 2010 at 2:00 pm
I'm curious, why can't you use SSIS?
July 23, 2010 at 2:21 pm
1) that is the default port for sftp so no need to specify
2) try space: servername<space>22
to be clear: "sftp" = the ssh ftp protocol?
that trace looks like actual "ftp" - completely different protocol
July 23, 2010 at 2:55 pm
port 22 is default so its connecting fine and file is partly transferred,
how do i increase processing time in sql server???
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply