Results 1 to 5 of 5

Thread: Executing a DTS package via .NET

  1. #1

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375

    Executing a DTS package via .NET

    Hi, Can someone please tell me if and how I can execute a SQL server 2000 DTS package via .NET?

    Thanks in advance
    MarkusJ

  2. #2
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    well just pass the command text to execute the package to a command object:-

    dim conn as new sqlclient.sqlconnection(connectionstring)
    dim cmd as new sqlclient.sqlcommand(conn)
    cmd.commandtype = CommandType.Text
    cmd.commandtext = "command text to execute package"

    try
    conn.open
    cmd.executenonquery
    finally
    conn.close
    end try

  3. #3

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    Hi, I was actually wondering if there was a specific DTS function call in ADO.NET.

    I did use the command object of SQLClient namespace but I do not know how to call the DTS package from the command text.

    eg oCOmmand.commandtext="exec ??????"

    just going "exec NameOfDTSpackage" implies that I am trying to call a stored procedure under SQL and not a DTS package.

    Thanks again for your help
    Cheers
    MarkusJ

  4. #4
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    Yeah I'm not familiar with the DTS object model and whether ADO.Net has an interface to it. I doubt it though. There is a stored procedure called sp_start_job which might do what you want. Just create a job in sql server agent to run your package.

  5. #5

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    Cool, thanks for your help
    MarkusJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width