dbTalk Databases Forums  

Multiple occurences running concurrently

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


Discuss Multiple occurences running concurrently in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gary C.
 
Posts: n/a

Default Multiple occurences running concurrently - 09-22-2004 , 09:21 AM






Here's what I'm trying to do.
I want one set of DTS packages to be able to run concurrently with
different data sources/targets without having to modify the DTS
packages.

I have setup the packages to point to UDLs/INIs which allow me the
ability to easily change the source/target, but the path to the
UDL/INI is hardcoded, and it seems I cannot use environment variables
to refer to the UDL/INI file path.

If I were running 2 packages in sequence, I could just swap out the
UDL/INI files before I run them, but I need concurrent.

I guess I could use a dynamic properties task to set the filepaths for
all the UDLs when the package starts execution, but I'd rather do
something else.

Any ideas? Thanks in advance.

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

Default RE: Multiple occurences running concurrently - 09-23-2004 , 09:13 AM






You can do this with ActiveX Script Tasks. With these Tasks you can read
information from the computers registry. In the registry you write the
location path. This is described in the Step By Step book for DTS. Example
codes are:

Task:
Set GV From Registry

Function Main()
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
Dim sConfigINIPath
sConfigINIPath =
wshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Fase 3SiQnal\ConfigFile")
Set wshShell = Nothing
DTSGlobalVariables("gsConfigINIPath").Value = sConfigINIPath
Main = DTSTaskExecResult_Success
End Function

Task:
Set INI Location From GV

Function Main()
Dim sConfigINIPath
sConfigINIPath = DTSGlobalVariables("gsConfigINIPath").Value
Dim oPKG
Set oPKG = DTSGlobalVariables.Parent
Dim oAssignments
Dim oAssignment
' DTSTask_ DTSDynamicPropertiesTask_1 is the task described as the
Properties From INI File task
Set oAssignments =
oPKG.Tasks("DTSTask_DTSDynamicPropertiesTask_1").C ustomTask.Assignments
For Each oAssignment In oAssignments
oAssignment.SourceIniFileFileName = sConfigINIPath
Next
Main = DTSTaskExecResult_Success
End Function

You need a global variable in the DTS-package.

Another solution might be a table with variables within the database. For
every database you run the package on the table might contain different
values.

Make table:
CREATE TABLE [dbo].[PackageGVs] (
[PackageName] [nvarchar] (100) NOT NULL ,
[GVName] [varchar] (50) NOT NULL ,
[GVValue] [nvarchar] (1000) NOT NULL ,
[ConfigID] [int] NOT NULL,
[Description] [nvarchar] (100) NULL)

Pick-up the Global Variables:
SELECT GVName, GVValue
FROM PackageGVs
WHERE PackageName = 'MIS Ver Laden'
AND ConfigID = ?

Set the variables
Function Main()
Dim oPkg
Set oPkg = DTSGlobalVariables.Parent
Dim RS
Set RS = DTSGlobalVariables("goGVsPickedUp").Value
Set RS.ActiveConnection = Nothing
Dim GVName
Dim GVValue
Dim GVType
If RS.RecordCount > 0 Then
RS.MoveFirst
Do While Not RS.EOF
GVName = RS.Fields("GVName").value
GVValue = RS.Fields("GVValue").value
GVType = UCase(Left(GVName, 2))
Select Case GVType
Case "GS"
DTSGlobalVariables(CStr(GVName)).Value =
CStr(GVValue)
Case "GI"
DTSGlobalVariables(CStr(GVName)).Value =
CInt(GVValue)
Case "GB"
DTSGlobalVariables(CStr(GVName)).Value =
CBool(GVValue)
Case Else
DTSGlobalVariables(CStr(GVName)).Value =
CStr(GVValue)
End Select
RS.MoveNext
Loop
End If
Set RS = Nothing
Main = DTSTaskExecResult_Success
End Function

Off course you'll need to set some Variables in the package to run this.

I hope this helpes you.

"Gary C." wrote:

Quote:
Here's what I'm trying to do.
I want one set of DTS packages to be able to run concurrently with
different data sources/targets without having to modify the DTS
packages.

I have setup the packages to point to UDLs/INIs which allow me the
ability to easily change the source/target, but the path to the
UDL/INI is hardcoded, and it seems I cannot use environment variables
to refer to the UDL/INI file path.

If I were running 2 packages in sequence, I could just swap out the
UDL/INI files before I run them, but I need concurrent.

I guess I could use a dynamic properties task to set the filepaths for
all the UDLs when the package starts execution, but I'd rather do
something else.

Any ideas? Thanks in advance.


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.