Scripting the IP Resolution DTS Task
The following script creates and runs the IP Resolution DTS task. This script can be used to create a package containing the DTS task to be run. The sample script can be run in two different ways. You can run the package on the command line by using the command DTSRun.exe. The file DTSRun.exe is automatically installed on your server when you install SQL Server. Or you can copy the script into a Visual Basic script file (.vbs) and run it by using cscript, for example, <drive>:cscript <filename>.vbs.
To successfully complete the import of data into the Data Warehouse, run the DTS tasks in the following order:
- Configuration Synchronization
- Web Server Log Import
- Transaction Data Import
- Product Catalog Import
- Profile Data Import
- Campaign Data Import
- Data Deletion
- Model Builder
- IP Resolution
- Report Preparation
- Report caching
For more information about the DTSIPResolution object, see DTSIPResolution Object.
For a description of this DTS task, see Commerce Server DTS Tasks.
'******************************************************************
' IP Resolution DTS Task
' This script creates a DTS package and runs it.
'******************************************************************
Dim oPackage
Dim oTask
Dim oStep
Dim oProps
Dim oTaskProps
set oPackage = WScript.CreateOBject("DTS.Package")
'******************************************************************
' Define package properties.
'******************************************************************
oPackage.Name = "IPResolution DTS Task "
oPackage.Description = "Resolves Internet Protocol (IP) addresses from the imported user data."
'******************************************************************
' Create a task.
'******************************************************************
Set oTask = oPackage.Tasks.New("Commerce.DTSIPResolution")
oTask.Name = "Task1"
oTask.Description = "Creates a task for IPRes DTS"
Set oTaskProps = oTask.Properties
'*******************************************************************
' Set IP Resolution DTS task properties.
'*******************************************************************
oTaskProps("SourceName").value = "Data Warehouse 1"
oTaskProps("ProcessingType").value = 0
oTaskProps("BatchSize").value = 500
oTaskProps("LocalDomainName").value = "microsoft.com"
oTaskProps("TimeOut").value = 60
oTaskProps("Ncache").value = 30
oPackage.Tasks.Add oTask
'******************************************************************
' Create a step.
'******************************************************************
Set oStep = oPackage.Steps.New
oStep.Name = "Step1"
oStep.TaskName = "Task1"
'For custom tasks written in VB, the steps cannot run on a secondary
' thread.
oStep.ExecuteInMainThread = True
oPackage.Steps.Add oStep
' ******************************************************************
' Execute the package.
' ******************************************************************
oPackage.Execute
For I = 1 To oPackage.Steps.Count
If oPackage.Steps(I).ExecutionResult = 1 Then
iStatus = False
MsgBox oPackage.Steps(I).Name + " in the " + _
oPackage.Name + " failed."
End If
Next
MsgBox oPackage.Name + " Done"
Set oStep = Nothing
Set oTaskProps = Nothing
Set oProps = Nothing
Set oTaskProps = Nothing
Set oPackage = Nothing
Copyright © 2005 Microsoft Corporation.
All rights reserved.