dbTalk Databases Forums  

Can change SourceObjectName of Data Pump Object?

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


Discuss Can change SourceObjectName of Data Pump Object? in the microsoft.public.sqlserver.dts forum.



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

Default Can change SourceObjectName of Data Pump Object? - 09-20-2005 , 05:51 PM






I am trying to change the SourceObjectName of a datapump which reads an
Excel file. It poops on: tsk.SourceObjectName = "Sheet2$" saying this
method is not supported. OK. I need to read an Excel file whose sheet name
changes each time. DTS defaults to "Sheet1$" which will not work in this
case.

Any ideas? Thanks


Function Main()
Dim pkg, tsk
set pkg = DTSGlobalVariables.Parent
set tsk = pkg.Tasks("DTSTask_DTSDataPumpTask_1")
tsk.SourceObjectName = "Sheet2$"
Main = DTSTaskExecResult_Success
End Function


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Can change SourceObjectName of Data Pump Object? - 09-20-2005 , 06:01 PM






Try

set tsk = pkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask




"Snake" <Snake (AT) discussions (DOT) microsoft.com> wrote


Quote:
I am trying to change the SourceObjectName of a datapump which reads an
Excel file. It poops on: tsk.SourceObjectName = "Sheet2$" saying this
method is not supported. OK. I need to read an Excel file whose sheet
name
changes each time. DTS defaults to "Sheet1$" which will not work in
this
case.

Any ideas? Thanks


Function Main()
Dim pkg, tsk
set pkg = DTSGlobalVariables.Parent
set tsk = pkg.Tasks("DTSTask_DTSDataPumpTask_1")
tsk.SourceObjectName = "Sheet2$"
Main = DTSTaskExecResult_Success
End Function


Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Can change SourceObjectName of Data Pump Object? - 09-20-2005 , 06:02 PM



Try

set tsk = pkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask

Allan

"Snake" <Snake (AT) discussions (DOT) microsoft.com> wrote


Quote:
I am trying to change the SourceObjectName of a datapump which reads an
Excel file. It poops on: tsk.SourceObjectName = "Sheet2$" saying this
method is not supported. OK. I need to read an Excel file whose sheet
name
changes each time. DTS defaults to "Sheet1$" which will not work in
this
case.

Any ideas? Thanks


Function Main()
Dim pkg, tsk
set pkg = DTSGlobalVariables.Parent
set tsk = pkg.Tasks("DTSTask_DTSDataPumpTask_1")
tsk.SourceObjectName = "Sheet2$"
Main = DTSTaskExecResult_Success
End Function


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.