dbTalk Databases Forums  

Execute DTS Package from stored procedure and pass parameter

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Execute DTS Package from stored procedure and pass parameter in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rmcompute
 
Posts: n/a

Default Execute DTS Package from stored procedure and pass parameter - 02-14-2008 , 11:55 AM






I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #2  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM






Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #3  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM



Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #4  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM



Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #5  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM



Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #6  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM



Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #7  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM



Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #8  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM



Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
  #9  
Old   
Mike K
 
Posts: n/a

Default RE: Execute DTS Package from stored procedure and pass parameter - 03-11-2008 , 08:39 AM



Lookup running DTEXEC. You can use CMDSHELL to call DTEXEC and pass the
parameters to it.

"rmcompute" wrote:

Quote:
I have created an SQL stored procedure to execute a DTS package. I am looping
through a table to obtain a branch number and then running the DTS package
for that branch. Is there a wat to pass the branch number to the DTS package
and on which statment and where is it placed?

EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

EXEC @hr = sp_OAMethod @object, 'LoadFromStorageFile',
NULL, '\\Test\SAMLoadTest.dts', ''

EXEC @hr = sp_OAMethod @object, 'Execute'


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.