![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I found a great piece of code on the web that allows me to execute a DTS package on the server by using a stored procedure. Here is the code. 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, 'c:\test.dts', '' /* I would like to change reference to the SQL Server stored DTS package located under Local packages */ 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 The code works great but the problem is that I have to use the SQL script DTS file stored on the hard drive. I would like to use the DTS package on the SQL Server under Local Packages. How do I reference the Local Packages under SQL Server rather than using the DTS file stored on the hard drive? Thank you in advance, Ken |
![]() |
| Thread Tools | |
| Display Modes | |
| |