locked
SFTP on window server 2008 RRS feed

  • Question

  • I want to know the syntax of SFTP command that will execute by sql agent job and what steps will I have to follow to do public key authentication ? I am using SFTP to transfer files from window server 2008 to another window server 2008.


    Nitin Varshneya

    Tuesday, January 8, 2013 2:31 PM

Answers

  • SQLCMD -S Server -Q"EXEC msdb..sp_start_job 'yourjob'"

    This assumes Windows authentication. To use SQL Server authentication:

    SQLCMD -U usr -P pwd -S Server -Q"EXEC msdb..sp_start_job 'yourjob'"

    These are commands that you would execute from the Windows command line. How to access that command line from SFTP is beyond the scope of this forum.

    I am not sure what you mean with public key authentication in this context.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Tuesday, January 8, 2013 10:53 PM

All replies

  • SQLCMD -S Server -Q"EXEC msdb..sp_start_job 'yourjob'"

    This assumes Windows authentication. To use SQL Server authentication:

    SQLCMD -U usr -P pwd -S Server -Q"EXEC msdb..sp_start_job 'yourjob'"

    These are commands that you would execute from the Windows command line. How to access that command line from SFTP is beyond the scope of this forum.

    I am not sure what you mean with public key authentication in this context.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Tuesday, January 8, 2013 10:53 PM
  • Regarding SFTP tasks, you can see the discussion here, periodically updated from 2007 - 2012.
    http://www.sqlservercentral.com/Forums/Topic366150-148-5.aspx

    Suggestions:

    http://ssissftp.codeplex.com/  A custom component for SSIS.  SSIS has an FTP component, so this fleshes that out.

    http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html  Using PuTTY and its component

    http://winscp.net/eng/docs/free_sftp_client_for_windows Another SFTP client that some have used.

    FWIW,
    RLF


    • Edited by SQLWork Friday, January 11, 2013 4:08 PM
    Friday, January 11, 2013 4:08 PM
  • I am still not able to find code for SFTP with public key authentication. :(

    which microsoft forum should I use to ask query regarding SFTP ?


    Nitin Varshneya

    Wednesday, January 30, 2013 7:24 AM
  • Is it possible to call shell script files(.sh) from Control-M jobs ?

    sh files are calling the function/storeproc of sql server database. 


    Nitin Varshneya

    Wednesday, January 30, 2013 7:31 AM