Sunday, March 11, 2012

DTS package doesnt execute

I'm pulling my hair out. After several attempts I got the sp_OAMethod
to execute without error. Unfortunately the DTS package isn't
executing. It also isn't returning any error. What could I be doing
wrong? Any help would be appreciated.

This is the

EXEC @.hr=sp_OACreate 'DTS.Package', @.oPKG OUTPUT
IF @.hr<>0
BEGIN
EXEC sp_OAGetErrorInfo @.oPKG,@.src OUT, @.desc OUT
SELECT hr=convert(varbinary(4),@.hr), Source=@.src, Description=@.desc

RAISERROR (@.desc,16,1)
RETURN

END

EXEC @.hr=sp_OAMethod
@.oPKG,'LoadFromSQLServer',NULL,@.ServerName='CAMDEV 0',@.PackageName='TestPkg',@.Flags=256
IF @.hr<>0
BEGIN
EXEC sp_OAGetErrorInfo @.oPKG,@.src OUT, @.desc OUT
SELECT hr=convert(varbinary(4),@.hr), Source=@.src, Description=@.desc

RAISERROR (@.desc,16,1)
RETURN
END

--Execute the pkg
EXEC @.hr=sp_OAMethod @.oPKG,'Execute'
IF @.hr<>0
BEGIN
EXEC sp_OAGetErrorInfo @.oPKG,@.src OUT, @.desc OUT
SELECT hr=convert(varbinary(4),@.hr), Source=@.src, Description=@.desc
print @.desc
RAISERROR (@.desc,16,1)
RETURN
ENDYour code runs a package correctly when I tried it, but I suspect
there's probably an error within the package itself - it's being
Executed correctly, but then one particular step is failing. I would
enable package logging and an error file (if you haven't already), and
see what that shows.

Since DTS is client-side, even if you've tested the package
successfully from your workstation in EM, there may be problems when
you execute it from the server:

http://support.microsoft.com/defaul...kb;en-us;269074

Simon

No comments:

Post a Comment