database_id - property in ROOT\WMI namespace

database_id in other namespaces

List of classes with database_id local property in ROOT\WMI namespace

propertyClassOrigin
database_idadd_file_in_masteradd_file_in_master
database_idadd_file_rollbackadd_file_rollback
database_idafter_natively_compiled_proc_entry_removal_on_dropafter_natively_compiled_proc_entry_removal_on_drop
database_idafter_snipping_some_logafter_snipping_some_log
database_idall_database_segment_files_attachall_database_segment_files_attach
database_idall_database_segments_createall_database_segments_create
database_idall_database_segments_dropall_database_segments_drop
database_idall_database_segments_metadata_createall_database_segments_metadata_create
database_idall_files_createdall_files_created
database_idapp_domain_ring_buffer_recordedapp_domain_ring_buffer_recorded
database_idauto_statsauto_stats
database_idbackground_job_errorbackground_job_error
database_idbackup_restore_before_filestreambackup_restore_before_filestream
database_idbad_memory_fixedbad_memory_fixed
database_idbefore_natively_compiled_proc_entry_removal_on_dropbefore_natively_compiled_proc_entry_removal_on_drop
database_idblocked_process_reportblocked_process_report
database_idbrick_files_metadata_remapbrick_files_metadata_remap
database_idbroker_activation_stored_procedure_invokedbroker_activation_stored_procedure_invoked
database_idbroker_activation_task_abortedbroker_activation_task_aborted
database_idbroker_activation_task_limit_reachedbroker_activation_task_limit_reached
database_idbroker_activation_task_startedbroker_activation_task_started
database_idbroker_conversationbroker_conversation
database_idbroker_dialog_state_changebroker_dialog_state_change
database_idbroker_queue_activation_alertbroker_queue_activation_alert
database_idbroker_queue_disabledbroker_queue_disabled
database_idbroker_transmission_acksm_action_firebroker_transmission_acksm_action_fire
database_idbroker_transmission_acksm_event_beginbroker_transmission_acksm_event_begin
database_idbroker_transmission_acksm_event_endbroker_transmission_acksm_event_end
database_idbroker_transmission_deliverysm_action_firebroker_transmission_deliverysm_action_fire
database_idbroker_transmission_deliverysm_event_beginbroker_transmission_deliverysm_event_begin
database_idbroker_transmission_deliverysm_event_endbroker_transmission_deliverysm_event_end
database_idbroker_transmission_lazyflusher_removebroker_transmission_lazyflusher_remove
database_idbroker_transmission_lazyflusher_submitbroker_transmission_lazyflusher_submit
database_idbroker_transmission_object_delete_beginbroker_transmission_object_delete_begin
database_idbroker_transmission_object_delete_endbroker_transmission_object_delete_end
database_idbroker_transmission_object_getbroker_transmission_object_get
database_idbroker_transmission_object_worktable_load_beginbroker_transmission_object_worktable_load_begin
database_idbroker_transmission_object_worktable_load_endbroker_transmission_object_worktable_load_end
database_idbroker_transmission_object_worktable_save_beginbroker_transmission_object_worktable_save_begin
database_idbroker_transmission_object_worktable_save_endbroker_transmission_object_worktable_save_end
database_idbroker_transmission_timer_armedbroker_transmission_timer_armed
database_idbroker_transmission_timer_firebroker_transmission_timer_fire
database_idbroker_transmission_timer_resetbroker_transmission_timer_reset
database_idbroker_transmission_timer_setbroker_transmission_timer_set
database_idbroker_transmitter_service_createbroker_transmitter_service_create
database_idbroker_transmitter_service_matchbroker_transmitter_service_match
database_idbroker_transmitter_service_sendbroker_transmitter_service_send
database_idcatalog_metadata_cache_entry_addedcatalog_metadata_cache_entry_added
database_idcatalog_metadata_cache_entry_pinnedcatalog_metadata_cache_entry_pinned
database_idcatalog_metadata_cache_entry_removedcatalog_metadata_cache_entry_removed
database_idcatalog_metadata_cache_entry_unpinnedcatalog_metadata_cache_entry_unpinned
database_idcatalog_metadata_cache_hitcatalog_metadata_cache_hit
database_idchange_based_metadata_cache_refreshchange_based_metadata_cache_refresh
database_idchange_tracking_cleanupchange_tracking_cleanup
database_idcheck_phase_tracingcheck_phase_tracing
database_idcheck_thread_message_statisticscheck_thread_message_statistics
database_idcheck_thread_page_io_statisticscheck_thread_page_io_statistics
database_idcheck_thread_page_latch_statisticscheck_thread_page_latch_statistics
database_idcheckpoint_begincheckpoint_begin
database_idcheckpoint_endcheckpoint_end
database_idclustered_columnstore_index_rebuildclustered_columnstore_index_rebuild
database_idcolumn_store_index_build_process_segmentcolumn_store_index_build_process_segment
database_idcolumn_store_object_pool_hitcolumn_store_object_pool_hit
database_idcolumn_store_object_pool_misscolumn_store_object_pool_miss
database_idcolumnstore_tuple_mover_begin_compresscolumnstore_tuple_mover_begin_compress
database_idcolumnstore_tuple_mover_end_compresscolumnstore_tuple_mover_end_compress
database_idconstant_page_corruption_detectedconstant_page_corruption_detected
database_iddatabase_agent_create_filegroupdatabase_agent_create_filegroup
database_iddatabase_agent_drop_filegroupdatabase_agent_drop_filegroup
database_iddatabase_agent_local_operation_begindatabase_agent_local_operation_begin
database_iddatabase_agent_local_operation_enddatabase_agent_local_operation_end
database_iddatabase_agent_request_begindatabase_agent_request_begin
database_iddatabase_agent_request_enddatabase_agent_request_end
database_iddatabase_attacheddatabase_attached
database_iddatabase_bootpage_syncdatabase_bootpage_sync
database_iddatabase_cmptlevel_changedatabase_cmptlevel_change
database_iddatabase_creation_dbid_reservedatabase_creation_dbid_reserve
database_iddatabase_ddl_stmt_runtime_checkdatabase_ddl_stmt_runtime_check
database_iddatabase_ddl_stmt_startdatabase_ddl_stmt_start
database_iddatabase_detacheddatabase_detached
database_iddatabase_file_size_changedatabase_file_size_change
database_iddatabase_migrate_to_matrixdatabase_migrate_to_matrix
database_iddatabase_mirroring_state_changedatabase_mirroring_state_change
database_iddatabase_opendatabase_open
database_iddatabase_option_changedatabase_option_change
database_iddatabase_poll_segment_statedatabase_poll_segment_state
database_iddatabase_renamedatabase_rename
database_iddatabase_segment_all_files_createdatabase_segment_all_files_create
database_iddatabase_segment_creation_begindatabase_segment_creation_begin
database_iddatabase_segment_creation_enddatabase_segment_creation_end
database_iddatabase_segment_local_creation_begindatabase_segment_local_creation_begin
database_iddatabase_segment_local_creation_enddatabase_segment_local_creation_end
database_iddatabase_segment_state_changedatabase_segment_state_change
database_iddatabase_segment_state_change_notificationdatabase_segment_state_change_notification
database_iddatabase_starteddatabase_started
database_iddatabase_startup_begindatabase_startup_begin
database_iddatabase_stoppeddatabase_stopped
database_iddatabase_suspect_data_pagedatabase_suspect_data_page
database_iddatabases_backup_restore_throughputdatabases_backup_restore_throughput
database_iddatabases_bulk_copy_rowsdatabases_bulk_copy_rows
database_iddatabases_bulk_copy_throughputdatabases_bulk_copy_throughput
database_iddatabases_bulk_insert_rowsdatabases_bulk_insert_rows
database_iddatabases_bulk_insert_throughputdatabases_bulk_insert_throughput
database_iddatabases_data_file_size_changeddatabases_data_file_size_changed
database_iddatabases_dbcc_logical_scandatabases_dbcc_logical_scan
database_iddatabases_log_cache_hitdatabases_log_cache_hit
database_iddatabases_log_cache_readdatabases_log_cache_read
database_iddatabases_log_file_size_changeddatabases_log_file_size_changed
database_iddatabases_log_file_used_size_changeddatabases_log_file_used_size_changed
database_iddatabases_log_flushdatabases_log_flush
database_iddatabases_log_flush_waitdatabases_log_flush_wait
database_iddatabases_log_growthdatabases_log_growth
database_iddatabases_log_shrinkdatabases_log_shrink
database_iddatabases_log_truncationdatabases_log_truncation
database_iddatabases_shrink_data_movementdatabases_shrink_data_movement
database_iddb_lock_acquired_from_cachedb_lock_acquired_from_cache
database_iddb_lock_released_from_cachedb_lock_released_from_cache
database_iddbtable_initializedbtable_initialize
database_iddbtable_options_refreshdbtable_options_refresh
database_iddbtable_startupdbtable_startup
database_idddl_with_wait_at_low_priorityddl_with_wait_at_low_priority
database_iddelete_or_mark_filedelete_or_mark_file
database_iddisk_log_readdisk_log_read
database_iddisk_log_read_ignoredisk_log_read_ignore
database_iddisk_write_asyncdisk_write_async
database_iddistribution_db_policy_changedistribution_db_policy_change
database_iddrop_database_ex_lock_acquiredrop_database_ex_lock_acquire
database_iddrop_database_metadata_removedrop_database_metadata_remove
database_iddrop_file_committeddrop_file_committed
database_iddrop_file_prepareddrop_file_prepared
database_iddrop_file_rollbackdrop_file_rollback
database_iddyn_throttle_checkpointdyn_throttle_checkpoint
database_idexisting_connectionexisting_connection
database_idfastloadcontext_enabledfastloadcontext_enabled
database_idfile_added_in_databasefile_added_in_database
database_idfile_readfile_read
database_idfile_read_completedfile_read_completed
database_idfile_read_enqueuedfile_read_enqueued
database_idfile_read_throttledfile_read_throttled
database_idfile_recreate_failurefile_recreate_failure
database_idfile_write_completedfile_write_completed
database_idfile_write_enqueuedfile_write_enqueued
database_idfile_write_throttledfile_write_throttled
database_idfile_writtenfile_written
database_idfile_written_to_replicafile_written_to_replica
database_idfilegroup_name_changefilegroup_name_change
database_idfilegroup_property_changefilegroup_property_change
database_idfull_text_crawl_startedfull_text_crawl_started
database_idfull_text_crawl_stoppedfull_text_crawl_stopped
database_idfulltext_query_recompilefulltext_query_recompile
database_idfulltext_reorganize_phase1_destination_fragmentfulltext_reorganize_phase1_destination_fragment
database_idfulltext_reorganize_phase1_source_fragmentfulltext_reorganize_phase1_source_fragment
database_idfulltext_reorganize_progressfulltext_reorganize_progress
database_idfulltext_reorganize_source_fragmentfulltext_reorganize_source_fragment
database_idfulltext_reorganize_startfulltext_reorganize_start
database_idfulltext_semantic_document_languagefulltext_semantic_document_language
database_idfulltext_test_access_pointfulltext_test_access_point
database_idghost_cleanup_task_packet_enqueueghost_cleanup_task_packet_enqueue
database_idghost_cleanup_task_process_packetghost_cleanup_task_process_packet
database_idghost_cleanup_task_process_pages_for_db_packetghost_cleanup_task_process_pages_for_db_packet
database_idglm_acquire_database_lock_exceptionglm_acquire_database_lock_exception
database_idglm_acquire_table_lock_exceptionglm_acquire_table_lock_exception
database_idglm_local_brick_acquire_requestglm_local_brick_acquire_request
database_idglm_local_brick_acquire_responseglm_local_brick_acquire_response
database_idglm_local_brick_release_requestglm_local_brick_release_request
database_idglm_local_brick_release_responseglm_local_brick_release_response
database_idglm_local_brick_undo_requestglm_local_brick_undo_request
database_idglm_local_brick_undo_responseglm_local_brick_undo_response
database_idglm_lock_acquire_beginglm_lock_acquire_begin
database_idglm_lock_acquire_endglm_lock_acquire_end
database_idglm_lock_release_beginglm_lock_release_begin
database_idglm_lock_release_endglm_lock_release_end
database_idglm_primary_brick_acquire_requestglm_primary_brick_acquire_request
database_idglm_primary_brick_acquire_responseglm_primary_brick_acquire_response
database_idglm_primary_brick_release_requestglm_primary_brick_release_request
database_idglm_primary_brick_release_responseglm_primary_brick_release_response
database_idglm_primary_brick_undo_exceptionglm_primary_brick_undo_exception
database_idglm_primary_brick_undo_responseglm_primary_brick_undo_response
database_idglm_release_database_lock_exceptionglm_release_database_lock_exception
database_idglm_release_table_lock_exceptionglm_release_table_lock_exception
database_idhadr_capture_compressed_log_cachehadr_capture_compressed_log_cache
database_idhadr_database_replica_disjoin_completionhadr_database_replica_disjoin_completion
database_idhadr_db_commit_mgr_hardenhadr_db_commit_mgr_harden
database_idhadr_db_commit_mgr_harden_still_waitinghadr_db_commit_mgr_harden_still_waiting
database_idhadr_db_commit_mgr_set_policyhadr_db_commit_mgr_set_policy
database_idhadr_db_commit_mgr_update_hardenhadr_db_commit_mgr_update_harden
database_idhadr_db_manager_apihadr_db_manager_api
database_idhadr_db_manager_db_queue_restarthadr_db_manager_db_queue_restart
database_idhadr_db_manager_db_restarthadr_db_manager_db_restart
database_idhadr_db_manager_db_shutdownhadr_db_manager_db_shutdown
database_idhadr_db_manager_db_startdbhadr_db_manager_db_startdb
database_idhadr_db_manager_redohadr_db_manager_redo
database_idhadr_db_manager_redo_controlhadr_db_manager_redo_control
database_idhadr_db_manager_scan_controlhadr_db_manager_scan_control
database_idhadr_db_manager_suspend_resumehadr_db_manager_suspend_resume
database_idhadr_db_manager_undohadr_db_manager_undo
database_idhadr_db_manager_user_controlhadr_db_manager_user_control
database_idhadr_db_partner_set_policyhadr_db_partner_set_policy
database_idhadr_db_partner_set_sync_statehadr_db_partner_set_sync_state
database_idhadr_filestream_log_interpreterhadr_filestream_log_interpreter
database_idhadr_filestream_processed_blockhadr_filestream_processed_block
database_idhadr_filestream_undo_inplace_updatehadr_filestream_undo_inplace_update
database_idindex_description_unpinindex_description_unpin
database_idlatch_acquiredlatch_acquired
database_idlatch_demotedlatch_demoted
database_idlatch_promotedlatch_promoted
database_idlatch_releasedlatch_released
database_idlatch_suspend_beginlatch_suspend_begin
database_idlatch_suspend_endlatch_suspend_end
database_idlatch_suspend_warninglatch_suspend_warning
database_idleaf_page_disfavoredleaf_page_disfavored
database_idlock_acquiredlock_acquired
database_idlock_cancellock_cancel
database_idlock_deadlocklock_deadlock
database_idlock_deadlock_chainlock_deadlock_chain
database_idlock_escalationlock_escalation
database_idlock_redo_blockedlock_redo_blocked
database_idlock_redo_unblockedlock_redo_unblocked
database_idlock_releasedlock_released
database_idlock_request_prioritylock_request_priority
database_idlock_request_priority_statelock_request_priority_state
database_idlock_timeoutlock_timeout
database_idlock_timeout_greater_than_0lock_timeout_greater_than_0
database_idlog_block_cachelog_block_cache
database_idlog_block_consumelog_block_consume
database_idlog_block_movelog_block_move
database_idlog_block_persistence_resetlog_block_persistence_reset
database_idlog_blocks_uncachelog_blocks_uncache
database_idlog_cache_buffer_refcounter_changelog_cache_buffer_refcounter_change
database_idlog_consumer_actlog_consumer_act
database_idlog_consumer_lifelog_consumer_life
database_idlog_consumer_read_aheadlog_consumer_read_ahead
database_idlog_flush_completelog_flush_complete
database_idlog_flush_requestedlog_flush_requested
database_idlog_flush_retrylog_flush_retry
database_idlog_flush_startlog_flush_start
database_idlog_generate_stalllog_generate_stall
database_idlog_io_completelog_io_complete
database_idlog_single_recordlog_single_record
database_idlogical_filegroup_createlogical_filegroup_create
database_idloginlogin
database_idlogreader_add_eorlogreader_add_eor
database_idlogreader_add_tran_infologreader_add_tran_info
database_idlogreader_apply_filter_proclogreader_apply_filter_proc
database_idlogreader_start_scanlogreader_start_scan
database_idlong_io_detectedlong_io_detected
database_idmatrix_database_state_changematrix_database_state_change
database_idmetadata_agent_catalog_updatedmetadata_agent_catalog_updated
database_idmetadata_agent_lock_objectmetadata_agent_lock_object
database_idmetadata_cache_addmetadata_cache_add
database_idmetadata_cache_flushmetadata_cache_flush
database_idmetadata_cache_hitmetadata_cache_hit
database_idmetadata_cache_missmetadata_cache_miss
database_idmetadata_cache_updatemetadata_cache_update
database_idmetadata_cache_vlr_postedmetadata_cache_vlr_posted
database_idmetadata_change_notification_subscribermetadata_change_notification_subscriber
database_idmetadata_database_mdversion_updatedmetadata_database_mdversion_updated
database_idmetadata_ddl_add_columnmetadata_ddl_add_column
database_idmetadata_ddl_alter_columnmetadata_ddl_alter_column
database_idmetadata_ddl_drop_columnmetadata_ddl_drop_column
database_idmetadata_initiate_lock_objectmetadata_initiate_lock_object
database_idmetadata_initiate_unlock_objectmetadata_initiate_unlock_object
database_idmetadata_lock_objectmetadata_lock_object
database_idmetadata_manager_catalog_deletedmetadata_manager_catalog_deleted
database_idmetadata_manager_catalog_insertedmetadata_manager_catalog_inserted
database_idmetadata_manager_catalog_updatedmetadata_manager_catalog_updated
database_idmetadata_manager_lock_objectmetadata_manager_lock_object
database_idmetadata_name_lookup_failedmetadata_name_lookup_failed
database_idmetadata_remove_from_cache_tracingmetadata_remove_from_cache_tracing
database_idmetadata_unlock_objectmetadata_unlock_object
database_idmetadata_version_updatemetadata_version_update
database_idmixed_extent_activationmixed_extent_activation
database_idmixed_extent_allocationmixed_extent_allocation
database_idmixed_extent_deallocationmixed_extent_deallocation
database_idmixed_page_allocationmixed_page_allocation
database_idmixed_page_deallocationmixed_page_deallocation
database_idmixed_page_scan_filemixed_page_scan_file
database_idmixed_page_scan_pagemixed_page_scan_page
database_idmixed_page_skipextentmixed_page_skipextent
database_idmodify_file_namemodify_file_name
database_idmodify_file_operationmodify_file_operation
database_idnatively_compiled_proc_execution_startednatively_compiled_proc_execution_started
database_idnatively_compiled_proc_slow_parameter_passingnatively_compiled_proc_slow_parameter_passing
database_idnew_log_interest_flipnew_log_interest_flip
database_idobject_alteredobject_altered
database_idobject_createdobject_created
database_idobject_deletedobject_deleted
database_idoiblob_cleanup_beginoiblob_cleanup_begin
database_idoiblob_cleanup_endoiblob_cleanup_end
database_idpage_compression_attempt_failedpage_compression_attempt_failed
database_idpage_compression_tracingpage_compression_tracing
database_idpage_splitpage_split
database_idphysical_filegroup_createphysical_filegroup_create
database_idpreconnect_completedpreconnect_completed
database_idpreconnect_startingpreconnect_starting
database_idprefetch_extentprefetch_extent
database_idprocess_killed_by_abort_blockersprocess_killed_by_abort_blockers
database_idprogress_report_online_index_operationprogress_report_online_index_operation
database_idrecovery_catch_checkpointrecovery_catch_checkpoint
database_idrecovery_force_oldest_pagerecovery_force_oldest_page
database_idrecovery_in_physicalrecovery_in_physical
database_idrecovery_in_rollbackrecovery_in_rollback
database_idrecovery_indirect_checkpointrecovery_indirect_checkpoint
database_idrecovery_redo_failpointrecovery_redo_failpoint
database_idrecovery_simple_log_truncaterecovery_simple_log_truncate
database_idrecovery_skip_checkpointrecovery_skip_checkpoint
database_idrecovery_target_missrecovery_target_miss
database_idrecovery_target_resetrecovery_target_reset
database_idrecovery_unit_file_metadata_copyrecovery_unit_file_metadata_copy
database_idrecovery_unit_metadata_createrecovery_unit_metadata_create
database_idrecovery_unit_metadata_truncate_data_droprecovery_unit_metadata_truncate_data_drop
database_idrecovery_unit_new_dbsegment_id_setrecovery_unit_new_dbsegment_id_set
database_idredo_caught_upredo_caught_up
database_idredo_single_recordredo_single_record
database_idredo_stop_clearredo_stop_clear
database_idredo_stop_setredo_stop_set
database_idredo_target_setredo_target_set
database_idredo_worker_entryredo_worker_entry
database_idredo_worker_exitredo_worker_exit
database_idremove_database_cacheremove_database_cache
database_idreplica_create_requestreplica_create_request
database_idreplica_create_startreplica_create_start
database_idreserve_log_spacereserve_log_space
database_idscan_startedscan_started
database_idscan_stoppedscan_stopped
database_idsecurity_cache_database_cleanupsecurity_cache_database_cleanup
database_idsecurity_cache_database_object_insertsecurity_cache_database_object_insert
database_idsecurity_cache_database_object_removalsecurity_cache_database_object_removal
database_idsecurity_cache_database_timestamp_incrementsecurity_cache_database_timestamp_increment
database_idselective_xml_index_no_compatible_sql_typeselective_xml_index_no_compatible_sql_type
database_idselective_xml_index_no_compatible_xsd_typesselective_xml_index_no_compatible_xsd_types
database_idselective_xml_index_path_not_indexedselective_xml_index_path_not_indexed
database_idselective_xml_index_path_not_supportedselective_xml_index_path_not_supported
database_idsort_add_run_tracingsort_add_run_tracing
database_idsort_memory_grant_adjustmentsort_memory_grant_adjustment
database_idsort_state_change_tracingsort_state_change_tracing
database_idsort_statistics_tracingsort_statistics_tracing
database_idsp_cache_hitsp_cache_hit
database_idsp_cache_insertsp_cache_insert
database_idsp_cache_misssp_cache_miss
database_idsp_cache_removesp_cache_remove
database_idsql_transaction_commit_single_phasesql_transaction_commit_single_phase
database_idsyscommittab_cleanupsyscommittab_cleanup
database_idtransaction_logtransaction_log
database_idvalidate_filevalidate_file
database_idxtp_create_procedurextp_create_procedure
database_idxtp_create_tablextp_create_table
database_idxtp_db_page_allocation_allowedxtp_db_page_allocation_allowed
database_idxtp_db_page_allocation_disallowedxtp_db_page_allocation_disallowed
database_idxtp_deploy_donextp_deploy_done
database_idxtp_matgenxtp_matgen
database_idxtp_offline_checkpoint_before_harden_completextp_offline_checkpoint_before_harden_complete
database_idxtp_offline_checkpoint_before_log_recordxtp_offline_checkpoint_before_log_record
database_idxtp_offline_checkpoint_bfc_updatextp_offline_checkpoint_bfc_update
database_idxtp_offline_checkpoint_scan_startxtp_offline_checkpoint_scan_start
database_idxtp_offline_checkpoint_scan_stopxtp_offline_checkpoint_scan_stop
database_idxtp_recover_donextp_recover_done
database_idxtp_recover_tablextp_recover_table
database_idxtp_storage_table_creatextp_storage_table_create

Code samples for database_id property

Get instance of WMI class using GetObject, database_id property of dbtable_initialize

Short VBS code - get a single specified instance of dbtable_initialize class or get a default unnamed instance (singleton) of the class, using one single command GetObject with exact path of the wmi object.

'https://wutils.com/wmi/
Dim wmiObject
Set wmiObject = GetObject( _
 "WINMGMTS:\\.\ROOT\WMI:" + _
 "dbtable_initialize.PropertyName=""SomeText""")
Wscript.Echo wmiObject.database_id 'or other property name, see properties
See more VBS samples of dbtable_initialize class

WMI query - sample windows WQL with C#, database_id property of dbtable_initialize

Get a specified instance of dbtable_initialize by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
See in another language: VBScript, VB.Net.
//https://wutils.com/wmi/

//Project -> Add reference -> System.Management
//using System.Management;

//create a management scope object
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\WMI");

//create object query
ObjectQuery query = new ObjectQuery("SELECT * FROM dbtable_initialize Where PropertyName=\"SomeText\"");

//create object searcher
ManagementObjectSearcher searcher =
                        new ManagementObjectSearcher(scope, query);

//get a collection of WMI objects
ManagementObjectCollection queryCollection = searcher.Get();

//enumerate the collection.
foreach (ManagementObject m in queryCollection) 
{
  // access properties of the WMI object
  Console.WriteLine("database_id : {0}", m["database_id"]);
  
}

WMI query - sample windows WQL with VB.Net, database_id property of dbtable_initialize

Get a specified instance of dbtable_initialize by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB.Net sample code.
See in another language: VBScript, C#
'Project -> Add reference -> System.Management
'Imports System.Management

'Get the namespace management scope
Dim Scope As New ManagementScope("\\.\ROOT\WMI")

'Get a result of WML query 
Dim Query As New ObjectQuery("SELECT * FROM dbtable_initialize Where PropertyName="SomeText"")

'Create object searcher
Dim Searcher As New ManagementObjectSearcher(Scope, Query)

'Get a collection of WMI objects
Dim queryCollection As ManagementObjectCollection = Searcher.Get

'Enumerate wmi object 
For Each mObject As ManagementObject In queryCollection
  'write out some property value
  Console.WriteLine("database_id : {0}", mObject("database_id"))
Next
comments powered by Disqus
WUtils.com