Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dsodimension.process

Status
Not open for further replies.

MarkElls

Programmer
Aug 26, 2003
57
GB
SQL Server 2000 Analysis services

Got a DTS with a script as below. Now the bit that does not seem to work is 'dsoDimension.Process processFull' I need this script to fully process all the dimensions. I am a bit concerned about the line
Set dsoDimension = CreateObject("DSO.MDStore")

Many thanks for your help.

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Const stateConnected = 1
Function Main()

Dim dsoServer
Dim dsoDatabase
Dim dsoDimension
Dim i
Dim j
Dim k
Dim strOLAPServer
Dim strOLAPDatabase
Dim str, logFile

On Error Resume Next
Set dsoServer = CreateObject("DSO.Server")
Set dsoDatabase = CreateObject("DSO.MDStore")
Set dsoDimension = CreateObject("DSO.MDStore")

strOLAPServer = DTSGlobalVariables("OLAPServer").Value
strOLAPDatabase = DTSGlobalVariables("OLAPDB").Value
Set logFile = DTSGlobalVariables("logFile").Value

str = Date & " " & Time & vbTab & ":> " & vbTab & "Server Name - " & DTSGlobalVariables("OLAPServer").Value & vbCrLf
logFile.Write str

str = Date & " " & Time & vbTab & ":> " & vbTab & "Catalog / Database Name - " & DTSGlobalVariables("OLAPDB").Value & vbCrLf
logFile.Write str

dsoServer.Connect strOLAPServer
If Err.Number <> 0 Then
str = Date & " " & Time & vbTab & ":> " & vbTab & "Error - " & CStr(Err.Number) & " " & Err.Description & vbCrLf
logFile.Write str
End if

Set dsoDatabase = dsoServer.MDStores(strOLAPDatabase) If Err.Number <> 0 Then
str = Date & " " & Time & vbTab & ":> " & vbTab & "Error - " & CStr(Err.Number) & " " & Err.Description & vbCrLf
logFile.Write str
End if

'********COUNT DIMS
i = dsoDatabase.Dimensions.Count
str = Date & " " & Time & vbTab & ":> " & vbTab & "Total Number Of Cubes - " & i & vbCrLf
logFile.Write str

'********PROCESS DIMENSIONS
For j = 1 To i
Err.Number = 0
Set dsoDimension = dsoDimension.MDStores(j)
str = Date & " " & Time & vbTab & ":> " & vbTab
str = str & "Processing Dimension Name - " & dsoDimension.Name &vbCrLf
logFile.Write str
dsoDimension.Process processFull

If Err.Number <> 0 Then
str = Date & " " & Time & vbTab & ":> " & vbTab
str = str & "Error - " & CStr(Err.Number) & " " & Err.Description & " Processing Dimension " & dsoDimension.Name & vbCrLf
logFile.Write str
End if
Next

Set objFSO = Nothing
Set dsoPartition = Nothing
Set dsoDimension = Nothing
Set dsoDatabase = Nothing

If Not dsoServer Is Nothing Then
If dsoServer.State = stateConnected Then
dsoServer.UnlockAllObjects
dsoServer.CloseServer
End If
End if

Set dsoServer = Nothing
Main = DTSTaskExecResult_Success
End Function
 
Changed code to this.

for each objDimension in dsoDatabase.Dimensions
dsoDimension = objDimension
dsoDimension.Process processFull
Next

However thgis appears to do an incremental process of dimension rather than full process. Whats wrong with the code.
Cheers.
Mark.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top