![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi Rick: You can use the With Events ReportProgress to access how many rows have been processed. We us it to determine the start and end time of our processing. Assuming you have a DSO object for the Analysis Services database called dsoDB you will place something like: '***The WithEvents allows us to use the ReportProgress option Public WithEvents dsoDB As DSO.Database in the declaration From there you can set-up the ReportProgress program like: Private Sub dsoDB_ReportProgress(o_Obj As Object, ByVal i_Action As Integer, l_Counter As Long, s_Message As String, cancel As Boolean) If g_cube_name = "WSD" Or g_cube_name = "BANNER" Or g_cube_name = "DCM" Then Select Case i_Action '***To capture the progress of the data loading Case mdactReadData '***102 '***If the iRowsStartIndicator = 0 then this must be the first progress report '***for the rows read. After the first pass through the iRowsStartIndicator '***is reset to 1 until the next partition is started. If g_rows_start_indicator = 0 Then g_analysis_services_processing_start_time = Now() g_rows_start_indicator = 1 End If '***These variable will get updated with each subsequent progress report '***from the server (after 1000 rows have been read) g_total_rows_processed = l_Counter g_analysis_services_processing_end_time = Now() Case mdactAggregate '***103 '***If the iAggregationsStartIndicator = 0 then this must be the first progress report '***for the rows read. After the first pass through the iAggregationsStartIndicator '***is reset to 1 until the next partition is started. If g_aggregations_start_indicator = 0 Then g_aggregations_start_time = Now() g_aggregations_start_indicator = 1 '**Updates the Cube Processing Instructions with the End Time of data processing (since this must be the first visit '**to the aggregation creation. Also set the number of rows processed and the start time of the aggregations End If '***These variable will get updated with each subsequent progress report g_aggregations_end_time = Now() ''' Case mdactExecuteSQL '***104 ''' Debug.Print s_Message End Select End If End Sub In terms of the constants, they can be placed in a separate module: Global Const mdactProcess = 1 Global Const mdactMerge = 2 Global Const mdactDelete = 3 Global Const mdactDeleteOldAggregations = 4 Global Const mdactRebuild = 5 Global Const mdactCommit = 6 Global Const mdactRollback = 7 Global Const mdactCreateIndexes = 8 Global Const mdactCreateTable = 9 Global Const mdactInsertInto = 10 Global Const mdactTransaction = 11 Global Const mdactInitialize = 12 Global Const mdactCreateView = 13 Global Const mdactWriteData = 101 Global Const mdactReadData = 102 (***Probably the one you want) Global Const mdactAggregate = 103 Global Const mdactExecuteSQL = 104 Global Const mdactNowExecutingSQL = 105 Global Const mdactExecuteModifiedSQL = 106 Global Const mdactConnecting = 107 Global Const mdactRowsAffected = 108 Global Const mdactError = 109 Global Const mdactWriteAggsAndIndexes = 110 Global Const mdactWriteSegment = 111 Global Const mdactDataMiningProgress = 112 HTH, Barry |
#4
| |||
| |||
|
|
Hi Rick: You can use the With Events ReportProgress to access how many rows have been processed. We us it to determine the start and end time of our processing. Assuming you have a DSO object for the Analysis Services database called dsoDB you will place something like: '***The WithEvents allows us to use the ReportProgress option Public WithEvents dsoDB As DSO.Database in the declaration From there you can set-up the ReportProgress program like: Private Sub dsoDB_ReportProgress(o_Obj As Object, ByVal i_Action As Integer, l_Counter As Long, s_Message As String, cancel As Boolean) If g_cube_name = "WSD" Or g_cube_name = "BANNER" Or g_cube_name = "DCM" Then Select Case i_Action '***To capture the progress of the data loading Case mdactReadData '***102 '***If the iRowsStartIndicator = 0 then this must be the first progress report '***for the rows read. After the first pass through the iRowsStartIndicator '***is reset to 1 until the next partition is started. If g_rows_start_indicator = 0 Then g_analysis_services_processing_start_time = Now() g_rows_start_indicator = 1 End If '***These variable will get updated with each subsequent progress report '***from the server (after 1000 rows have been read) g_total_rows_processed = l_Counter g_analysis_services_processing_end_time = Now() Case mdactAggregate '***103 '***If the iAggregationsStartIndicator = 0 then this must be the first progress report '***for the rows read. After the first pass through the iAggregationsStartIndicator '***is reset to 1 until the next partition is started. If g_aggregations_start_indicator = 0 Then g_aggregations_start_time = Now() g_aggregations_start_indicator = 1 '**Updates the Cube Processing Instructions with the End Time of data processing (since this must be the first visit '**to the aggregation creation. Also set the number of rows processed and the start time of the aggregations End If '***These variable will get updated with each subsequent progress report g_aggregations_end_time = Now() ''' Case mdactExecuteSQL '***104 ''' Debug.Print s_Message End Select End If End Sub In terms of the constants, they can be placed in a separate module: Global Const mdactProcess = 1 Global Const mdactMerge = 2 Global Const mdactDelete = 3 Global Const mdactDeleteOldAggregations = 4 Global Const mdactRebuild = 5 Global Const mdactCommit = 6 Global Const mdactRollback = 7 Global Const mdactCreateIndexes = 8 Global Const mdactCreateTable = 9 Global Const mdactInsertInto = 10 Global Const mdactTransaction = 11 Global Const mdactInitialize = 12 Global Const mdactCreateView = 13 Global Const mdactWriteData = 101 Global Const mdactReadData = 102 (***Probably the one you want) Global Const mdactAggregate = 103 Global Const mdactExecuteSQL = 104 Global Const mdactNowExecutingSQL = 105 Global Const mdactExecuteModifiedSQL = 106 Global Const mdactConnecting = 107 Global Const mdactRowsAffected = 108 Global Const mdactError = 109 Global Const mdactWriteAggsAndIndexes = 110 Global Const mdactWriteSegment = 111 Global Const mdactDataMiningProgress = 112 HTH, Barry |
![]() |
| Thread Tools | |
| Display Modes | |
| |