-
sp_OAMethod @oPKG 'Execute' problem
Hi All!
I try to execute DTS package which suppose to export table to flat file from SQL script. I'm not getting any errors from script but it looks like package is not running. The Package works fine from EM and the same script works fine on VBscirpt. (MSQL7 Windows 2000).
Maybe somebody met this problem before ?
Thanks.
Script:
declare @oPKG int,
@hr int
EXEC @hr = sp_OACreate 'DTS.Package', @oPKG OUT
IF @hr <> 0
BEGIN
PRINT '*** Create Package object failed'
RETURN
END
EXEC @hr = sp_OAMethod @oPKG OUT, 'LoadFromSqlServer', NULL,
@ServerName='DevServer', @PackageName='ExportToFlatFile', @Flags=256
IF @hr <> 0
BEGIN
PRINT '*** Load Package failed'
RETURN
END
EXEC @hr = sp_OAMethod @oPKG, 'Execute'
IF @hr <> 0
PRINT '*** Execute failed'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|