loading dts package through command line

  • Hi,

    I have a dts file on a particular drive which should be loaded to database through command line.From gui we generally follow follwing steps.

    1. open enterprise manger
    2. Right click on dts
    3. select all tasks
    4. select open template
    5. browse and select required file and save in to db

    I need this task to be done from command line can any one guide me.

     

    Thanks

    Ramesh kondru

  • I have done this using VB code.  I created this code in Access VBA after setting a reference to Microsoft DTS Package.

    Dim pkg As DTS.Package2

    Set pkg = New DTS.Package2

    pkg.LoadFromStorageFile "\\FileServer1\Folder\MyFile.dts", ""

    pkg.SaveToSQLServerAs "MyFileName", "MyServer", "", "", DTSSQLStgFlag_UseTrustedConnection

    I believe that you can do this in vbscript as well.

    Russel Loski, MCSD

    Russel Loski, MCSE Business Intelligence, Data Platform

  • Hi russel,

    Thanks for your response, but this to be achieved by back end scripts only.

    Thanks

    Ramesh

     

  • Is your backend script different from VBScript?

    There is some scripting tool that will allow you to run visual basic script from a command line.  You could also run this as an ActiveX script job in SQL Server.  You could also use an ActiveX task.

    You would alter my code by changing the following:

    Dim pkg As DTS.Package2

    Set pkg = New DTS.Package2

    to

    Dim pkg

    Set pkg = createobject("DTS.Package2")

     

    The rest should work.  If you don't have a VBScript writer, then this will be difficult.

    Russel Loski, MCSD

     

    Russel Loski, MCSE Business Intelligence, Data Platform

  • Hi Russel,

    Thanks for sparing time for this, my problem is this should be executed at client database server whrere only sql available. If you can suggest some commands or script which is purely sequel, that will be agreat help for me.

    Thanks

    Ramesh

  • See my response to your duplicate post.

     

    --------------------
    Colt 45 - the original point and click interface

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply