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
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