Call a UNIX shell script from a SQL Server job

Posted on 2007-08-06
Last Modified: 2013-12-26
Is it possible to call a UNIX shell script directly from a SQL Server job.  We have a process that copies a file to a UNIX box.  From there a shell script needs to be executed.  Is it possible to call that shell script from the SQL Server job, instead of creating a separate UNIX job?
Question by:wboulay
    LVL 42

    Expert Comment

    please clarify:
    can you call your UNIX shell script from the box where your sql server is?
    if 'yes' - you can do it from sqlserver job too
    LVL 42

    Accepted Solution

    you can run it by using xp_cmdshell stored procedure
    LVL 42

    Expert Comment

    one more:

    Create MS-DOS batch file with ftp code inside
    see example @
    and call it via xp_cmdshell from sql server job

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    SQL Query 18 66
    Start a field with integer 1 7 28
    Newspaper Article view in SQL Server 2012 4 45
    SSD vs SAS disk for SQL 3 9
    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Via a live example, show how to shrink a transaction log file down to a reasonable size.
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now