Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run DTS from query analyzer

Status
Not open for further replies.

washaw

Programmer
Feb 13, 2008
48
I have posted the thread in DTS forum but couldn't get response, I know this thread doesn't belong in this forum, but I am posting this incase somebody should respond.

I have a DTS called myDTS wich has one input parameter called inputParam, I am trying to run it from query analyzer and wrote this query


Code:
EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT
if @hr <> 0
BEGIN
    print 'error create DTS.Package'
    RETURN
END

EXEC @hr = sp_OAMethod @object, 'LoadFromSqlServer', NULL, 
  @ServerName='myServer', @PackageName='myDTS', @Flags=256
IF @hr <> 0
BEGIN
    PRINT '***  Load Package failed'
END

what is wrong with the above code and how can I excute the package with the input parameter?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top