Save your DTS pacakege in location as Structured Storage File.
Then call that file using the below syntax.
[tt]
/*--------Export Out any Error Lines to A File --------------------*/
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, '\\SERVERNAME\DTS\DTS_Package_Name.dts', '' -- Production File
IF @hr <> 0
BEGIN
print 'error LoadFromStorageFile'
RETURN
END
EXEC @hr = sp_OAMethod @object, 'Execute'
IF @hr <> 0
BEGIN
print 'Execute failed'
RETURN
END
[/tt]
--destroy the instance of the DTS
exec sp_OADestroy @object
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.