dbTalk Databases Forums  

DTS Transformation Error

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


Discuss DTS Transformation Error in the microsoft.public.sqlserver.dts forum.



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

Default DTS Transformation Error - 07-26-2006 , 02:18 PM






Hello All,

I come from a DBA back ground. So, I'm a new to DTS programming and VBScript
programming though I'm reasonably familiar with the DTS UI.

I was going through Ken Henderson's book and Wrox book in the hope of
learning DTS programming. I was going thru the "Parameterized DTS Package"
in his book and I'm trying to use the same concept to transfer a table from
a source table to a destination table.

I create two GlobalVariables, one for the Source table - gSourceTableName
and one for the Destination Table - gDestinationTableName. I assigned
Northwind..Orders to the source and junk..Orders to the destination. But
when I run the package it gives the error "Invalid Object name :
Junk..Orders". I found out why as the Orders table was not created at the
destination db (Junk in this case). But when I create the table, it gives
errors for the columns which it assumes by default when the package is
created.

I have attached the screen dump and the ActiveX Script which assigns the
Global Variables to the Source and Destination tables.

Can you anyone please help me in the direction.


ActiveX Script Task Properties : AssignGlobalVariables

'************************************************* *******' Visual Basic
ActiveX Script
'************************************************* *******'

Function Main()

Dim oPkg
Dim oTask
Set oPkg = DTSGlobalVariables.Parent
Set oTask = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").Customtask
oTask.SourceObjectName = DTSGlobalVariables("gSourceTableName").value
oTask.DestinationObjectName =
DTSGlobalVariables("gDestinationTableName").value

' msgbox "Source table is : " & DTSGlobalVariables("gSourceTableName").value
' msgbox "Destination table is : " &
DTSGlobalVariables("gDestinationTableName").value

Main = DTSTaskExecResult_Success
End Function


Thanks,
Gopi

P.S : I tried sending in the attachment as well but it failed to go through
though the attachment is only 103kb. If anyone wants to look at the screen
dump of the dts designer please send me a mail (rgopinath (AT) hotmail (DOT) com)

Reply With Quote
  #2  
Old   
gopi
 
Posts: n/a

Default Re: DTS Transformation Error - 07-26-2006 , 03:28 PM






I figured out that I have to specify the column mappings too in the
transformation phase. However, I dont know how/where to specify in the
script that the transformation should also copy the Source Table structure
to the Destination table structure. Can someone please help me out ?

Gopi

'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()

If DTSGlobalVariables("gSourceTableName").Value = "Region" then
DTSDestination("RegionID") = DTSSource("RegionID")
DTSDestination("RegionDescription") = DTSSource("RegionDescription")
End If

Main = DTSTransformStat_OK

End Function


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

Quote:
Hello All,

I come from a DBA back ground. So, I'm a new to DTS programming and
VBScript
programming though I'm reasonably familiar with the DTS UI.

I was going through Ken Henderson's book and Wrox book in the hope of
learning DTS programming. I was going thru the "Parameterized DTS Package"
in his book and I'm trying to use the same concept to transfer a table
from
a source table to a destination table.

I create two GlobalVariables, one for the Source table - gSourceTableName
and one for the Destination Table - gDestinationTableName. I assigned
Northwind..Orders to the source and junk..Orders to the destination. But
when I run the package it gives the error "Invalid Object name :
Junk..Orders". I found out why as the Orders table was not created at the
destination db (Junk in this case). But when I create the table, it gives
errors for the columns which it assumes by default when the package is
created.

I have attached the screen dump and the ActiveX Script which assigns the
Global Variables to the Source and Destination tables.

Can you anyone please help me in the direction.


ActiveX Script Task Properties : AssignGlobalVariables

'************************************************* *******' Visual Basic
ActiveX Script
'************************************************* *******'

Function Main()

Dim oPkg
Dim oTask
Set oPkg = DTSGlobalVariables.Parent
Set oTask = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").Customtask
oTask.SourceObjectName = DTSGlobalVariables("gSourceTableName").value
oTask.DestinationObjectName =
DTSGlobalVariables("gDestinationTableName").value

' msgbox "Source table is : " &
DTSGlobalVariables("gSourceTableName").value
' msgbox "Destination table is : " &
DTSGlobalVariables("gDestinationTableName").value

Main = DTSTaskExecResult_Success
End Function


Thanks,
Gopi

P.S : I tried sending in the attachment as well but it failed to go
through
though the attachment is only 103kb. If anyone wants to look at the screen
dump of the dts designer please send me a mail (rgopinath (AT) hotmail (DOT) com)



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

Default Re: DTS Transformation Error - 07-26-2006 , 04:10 PM



If you send me a mail I have a lot of code to do this

--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



"gopi" <rgopinath (AT) hotmail (DOT) com> wrote

Quote:
I figured out that I have to specify the column mappings too in the
transformation phase. However, I dont know how/where to specify in the
script that the transformation should also copy the Source Table structure
to the Destination table structure. Can someone please help me out ?

Gopi

'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************

' Copy each source column to the destination column
Function Main()

If DTSGlobalVariables("gSourceTableName").Value = "Region" then
DTSDestination("RegionID") = DTSSource("RegionID")
DTSDestination("RegionDescription") = DTSSource("RegionDescription")
End If

Main = DTSTransformStat_OK

End Function


"rgn" <rgn (AT) discussions (DOT) microsoft.com> wrote in message
news:5FD38312-DDFA-4FC2-8D9A-A2C1C11C0DBD (AT) microsoft (DOT) com...
Hello All,

I come from a DBA back ground. So, I'm a new to DTS programming and
VBScript
programming though I'm reasonably familiar with the DTS UI.

I was going through Ken Henderson's book and Wrox book in the hope of
learning DTS programming. I was going thru the "Parameterized DTS
Package"
in his book and I'm trying to use the same concept to transfer a table
from
a source table to a destination table.

I create two GlobalVariables, one for the Source table - gSourceTableName
and one for the Destination Table - gDestinationTableName. I assigned
Northwind..Orders to the source and junk..Orders to the destination. But
when I run the package it gives the error "Invalid Object name :
Junk..Orders". I found out why as the Orders table was not created at the
destination db (Junk in this case). But when I create the table, it gives
errors for the columns which it assumes by default when the package is
created.

I have attached the screen dump and the ActiveX Script which assigns the
Global Variables to the Source and Destination tables.

Can you anyone please help me in the direction.


ActiveX Script Task Properties : AssignGlobalVariables

'************************************************* *******' Visual Basic
ActiveX Script
'************************************************* *******'

Function Main()

Dim oPkg
Dim oTask
Set oPkg = DTSGlobalVariables.Parent
Set oTask = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").Customtask
oTask.SourceObjectName = DTSGlobalVariables("gSourceTableName").value
oTask.DestinationObjectName =
DTSGlobalVariables("gDestinationTableName").value

' msgbox "Source table is : " &
DTSGlobalVariables("gSourceTableName").value
' msgbox "Destination table is : " &
DTSGlobalVariables("gDestinationTableName").value

Main = DTSTaskExecResult_Success
End Function


Thanks,
Gopi

P.S : I tried sending in the attachment as well but it failed to go
through
though the attachment is only 103kb. If anyone wants to look at the
screen
dump of the dts designer please send me a mail (rgopinath (AT) hotmail (DOT) com)





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.