Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Declare global variable on the package

Author  Topic 

uri dimant
Starting Member

16 Posts

Posted - 2001-05-30 : 06:46:20
I use DTS to Transform Columns into Rows

How can I declare DTS global variable. I look at help and package properties ,it daesn't work.I get error "this object is not supported"

Example Source Data File:

Role, Name_1, Name_2, Name_3
Authors, Neil, Tony, Bruce
Publishers, Gary
Reviewers, Darren, Paul


Example Destination Table:

[Role] [varchar] (20)
[Name] [varchar] (20)


Results of "SELECT * FROM [dbo].[ColsToRows]":

Role Name
-------------------- --------------------
Authors Neil
Authors Tony
Authors Bruce
Publishers Gary
Reviewers Darren
Reviewers Paul



dim ColumnCounter
DTSGlobalVariables("ColumnCounter").value =1
Function Main()

DTSGlobalVariables("ColumnCounter") = DTSGlobalVariables("ColumnCounter") + 1

If DTSGlobalVariables("ColumnCounter") <= 4 Then
DTSDestination("Role") = DTSSource("Col001")
Main = DTSTransformStat_SkipFetch
Select Case DTSGlobalVariables("ColumnCounter")
Case 2
DTSDestination("Name") = DTSSource("Col002")
Case 3
DTSDestination("Name") = DTSSource("Col003")
Case 4
DTSDestination("Name") = DTSSource("Col004")
End Select
Else
DTSGlobalVariables("ColumnCounter") = 1
Main = DTSTransformStat_SkipInsert
End If

End Function




   

- Advertisement -