SQL Server Developer Center > SQL Server Forums > SQL Server Integration Services > Command line output with ssis script task
Ask a questionAsk a question
 

AnswerCommand line output with ssis script task

  • Thursday, October 29, 2009 7:51 PMmr_generic Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    I'm trying to start a server from my ssis package. My idea is to write a ssis script task, which sends a string to the command line.

    Do anyone know examples or ideas for this problem?

    Thanks !

Answers

  • Thursday, October 29, 2009 8:13 PMAdam TappisModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    For information about managing services remotely see this link http://www.experts-exchange.com/Operating_Systems/WinNT/Q_20896218.html (make sure you scroll right to the bottom of the page to see the answer)

    In SSIS, you can use expressions within the execute process task. If the command line is too tricky then you could resort to a script task that generates the commnad line into an SSIS variable and then use that variable as the source of the command for the execute process task.
    Adam Tappis. (MCSD VB6 & .NET, MCDBA SQL 2000)
  • Wednesday, November 04, 2009 4:05 PMmr_generic Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    I found the solution for my problem. Thank you for your excellent help. Here is the code:



    m_Process = New Process()
    With m_Process.StartInfo
    .FileName = "%PATH%startserver.exe"
    .Arguments = "arguments"
    .UseShellExecute = False
    .CreateNoWindow = True
    .RedirectStandardOutput = True
    .RedirectStandardError = True
    .RedirectStandardInput = True
    End With
    m_Process.Start()
    
    

    maybe it helps somebody else

All Replies

  • Thursday, October 29, 2009 7:56 PMSudeep Raj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    I'm trying to start a server from my ssis package. My idea is to write a ssis script task, which sends a string to the command line.

    Do anyone know examples or ideas for this problem?

    Thanks !

    What do you mean start a server??
    Can you start a server from code??

    Hope this helps !!
    Sudeep   |    My Blog
  • Thursday, October 29, 2009 8:13 PMAdam TappisModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    For information about managing services remotely see this link http://www.experts-exchange.com/Operating_Systems/WinNT/Q_20896218.html (make sure you scroll right to the bottom of the page to see the answer)

    In SSIS, you can use expressions within the execute process task. If the command line is too tricky then you could resort to a script task that generates the commnad line into an SSIS variable and then use that variable as the source of the command for the execute process task.
    Adam Tappis. (MCSD VB6 & .NET, MCDBA SQL 2000)
  • Thursday, October 29, 2009 8:33 PMSudeep Raj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    did you mean services?
    If thats the case Adam has given you the answer.

    Hope this helps !!
    Sudeep   |    My Blog
  • Thursday, October 29, 2009 8:42 PMAdam TappisModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    did you mean services?
    If thats the case Adam has given you the answer.

    Hope this helps !!
    Sudeep   |    My Blog

    I assumed he meant [SQL] Server [Service] as opposed to a physical server

    Saying that, I would presume that there are some management tools out there (from HP and the like) that could start a server remotely too e.g. wake on LAN (this is pure speculation and not my area of expertise).
    Adam Tappis. (MCSD VB6 & .NET, MCDBA SQL 2000)
  • Thursday, October 29, 2009 9:31 PMSudeep Raj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I assumed he meant [SQL] Server [Service] as opposed to a physical server

    Saying that, I would presume that there are some management tools out there (from HP and the like) that could start a server remotely too e.g. wake on LAN (this is pure speculation and not my area of expertise).
    Adam Tappis. (MCSD VB6 & .NET, MCDBA SQL 2000)
    Hey thanks Adam,
    Every day you learn something. That was something I did not expect at all, did some wiki and got this link.
    May be people who are interested cold go through this: Wake-on-LAN

    Hope this helps !!
    Sudeep   |    My Blog
  • Wednesday, November 04, 2009 4:05 PMmr_generic Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    I found the solution for my problem. Thank you for your excellent help. Here is the code:



    m_Process = New Process()
    With m_Process.StartInfo
    .FileName = "%PATH%startserver.exe"
    .Arguments = "arguments"
    .UseShellExecute = False
    .CreateNoWindow = True
    .RedirectStandardOutput = True
    .RedirectStandardError = True
    .RedirectStandardInput = True
    End With
    m_Process.Start()
    
    

    maybe it helps somebody else