washaw
Programmer
- Feb 13, 2008
- 48
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
what is wrong with the above code and how can excute the package with the input parameter?
Thanks
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 excute the package with the input parameter?
Thanks