Showing posts with label structured. Show all posts
Showing posts with label structured. Show all posts

Friday, March 23, 2012

rundts from within a stored procedure

I saved a dts package as a structured storage file and put it in a directory.

I'm trying to call and run it with the following stored procedure-

CREATE PROCEDURE run_dts AS

DECLARE @.object int
DECLARE @.hr int

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

EXEC @.hr = sp_OAMethod @.object, 'LoadFromStorageFile',
NULL, '\\server\directory\billing.dts', ''
IF @.hr <> 0
BEGIN
print 'error LoadFromStorageFile'
RETURN
END

EXEC @.hr = sp_OAMethod @.object, 'Execute'
IF @.hr <> 0
BEGIN
print 'Execute failed'
RETURN
END
GO

If I run this from query analyzer, it gives me "The command(s) completed successfully," but the dts doesn't run?

Any ideas?try checking the permission context\owner of the the stored procedure vs. that of the DTS package.

Friday, March 9, 2012

Run DTS packages from a structured storage file instead SQL Server

I'm wondering if this is a good idea. Can anybody list me the pros and cons
of each? We have someone pushing to run them from a file instead of a
package in SQL Server and I want to make sure there aren't any issues.
Thanks,
VanVan,
Using a structured storage file (.dts) increases the flexability of how and
where DTS packages are executed as well as increases the portability of DTS
packages. Security may be a concern using structured storage files.
HTH
Jerry
"Van" <Van@.discussions.microsoft.com> wrote in message
news:B3F75D14-7476-4DE1-A48C-A32F658F7B76@.microsoft.com...
> I'm wondering if this is a good idea. Can anybody list me the pros and
> cons
> of each? We have someone pushing to run them from a file instead of a
> package in SQL Server and I want to make sure there aren't any issues.
> Thanks,
> Van