dbTalk Databases Forums  

How to specify destination table

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


Discuss How to specify destination table in the microsoft.public.sqlserver.dts forum.



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

Default How to specify destination table - 06-10-2005 , 05:16 AM






I want to set destination table programmaticaly in Transformation Data Task.
Is it posible?

Thanks



Reply With Quote
  #2  
Old   
frank chang
 
Posts: n/a

Default RE: How to specify destination table - 06-10-2005 , 10:24 AM








"Arekas" wrote:

Quote:
I want to set destination table programmaticaly in Transformation Data Task.
Is it posible?

Thanks




Reply With Quote
  #3  
Old   
frank chang
 
Posts: n/a

Default RE: How to specify destination table - 06-10-2005 , 10:32 AM





"Arekas" wrote:

Quote:
I want to set destination table programmaticaly in Transformation Data Task.
Is it posible?

Thanks



Arekas, If you export your DTS package to a Visual Basic file, you can
find a wealth of information in the Visual Basic file. For example, if we
look at following excerpt from a DTS package I wrote a few weeks ago:

Public Sub Task_Sub10(ByVal goPackage As Object)

Dim oTask As DTS.Task
Dim oLookup As DTS.Lookup

Dim oCustomTask10 As DTS.DataPumpTask2
Set oTask = goPackage.Tasks.New("DTSDataPumpTask")
oTask.Name = "DTSTask_DTSDataPumpTask_7"
Set oCustomTask10 = oTask.CustomTask

oCustomTask10.Name = "DTSTask_DTSDataPumpTask_7"
oCustomTask10.Description = "Transform Data Task: undefined"
oCustomTask10.SourceConnectionID = 38
oCustomTask10.SourceSQLStatement = oCustomTask10.SourceSQLStatement &
"SET NOCOUNT ON" & vbCrLf
oCustomTask10.DestinationConnectionID = 39
oCustomTask10.DestinationObjectName = "PrototypeTable"
goPackage.Tasks.Add oTask
Set oCustomTask10 = Nothing
Set oTask = Nothing

End Sub


The DestinationObjectName may be changed programatically in the VB code
for your tranformation task.


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

Default Re: How to specify destination table - 06-13-2005 , 12:59 AM



Look at the DestinationObjectName of the DataPump task


dim pmp, dst

SET pmp = DTSGlobalVariables.Parent.Tasks("Name of task here").CustomTask

pmp.DestinationObjectName = "Insert Value Here"



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Arekas" <nospam (AT) stt (DOT) lt> wrote

Quote:
I want to set destination table programmaticaly in Transformation Data
Task. Is it posible?

Thanks




Reply With Quote
  #5  
Old   
Arekas
 
Posts: n/a

Default Re: How to specify destination table - 06-14-2005 , 11:46 AM



How to read global variable?

oCustomTask2.DestinationObjectName =
goPackage.GlobalVariables("DestTbl").Value

Returns "".

I use Dynamic Properties Task to set the global variable. Function
DTSGlobalVariables("DestTbl").Value returns correct value, but
goPackage.GlobalVariables("DestTbl").Value returns empty.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Look at the DestinationObjectName of the DataPump task


dim pmp, dst

SET pmp = DTSGlobalVariables.Parent.Tasks("Name of task here").CustomTask

pmp.DestinationObjectName = "Insert Value Here"



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Arekas" <nospam (AT) stt (DOT) lt> wrote in message
news:eEQL%23VabFHA.456 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
I want to set destination table programmaticaly in Transformation Data
Task. Is it posible?

Thanks






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

Default Re: How to specify destination table - 06-14-2005 , 04:15 PM



If you are using the DP task to set a GV to set the DestinationObjectName
then why not cut out the middle man and go stright to setting the
DestinationObjectName in the DP task.

Where are you?

In VB or in the package?



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Arekas" <nospam (AT) stt (DOT) lt> wrote

Quote:
How to read global variable?

oCustomTask2.DestinationObjectName =
goPackage.GlobalVariables("DestTbl").Value

Returns "".

I use Dynamic Properties Task to set the global variable. Function
DTSGlobalVariables("DestTbl").Value returns correct value, but
goPackage.GlobalVariables("DestTbl").Value returns empty.


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:OUuccw9bFHA.3912 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
Look at the DestinationObjectName of the DataPump task


dim pmp, dst

SET pmp = DTSGlobalVariables.Parent.Tasks("Name of task here").CustomTask

pmp.DestinationObjectName = "Insert Value Here"



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new
stuff.
www.konesans.com - Consultancy from the people who know


"Arekas" <nospam (AT) stt (DOT) lt> wrote in message
news:eEQL%23VabFHA.456 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
I want to set destination table programmaticaly in Transformation Data
Task. Is it posible?

Thanks








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.