ObjectId - property in ROOT\Microsoft\SqlServer\ServerEvents\MSSQLSERVER namespace

ObjectId in other namespaces

List of classes with ObjectId local property in ROOT\Microsoft\SqlServer\ServerEvents\MSSQLSERVER namespace

propertyClassOrigin
ObjectIdASSEMBLY_LOADASSEMBLY_LOAD
ObjectIdBITMAP_WARNINGBITMAP_WARNING
ObjectIdBLOCKED_PROCESS_REPORTBLOCKED_PROCESS_REPORT
ObjectIdDATABASE_SUSPECT_DATA_PAGEDATABASE_SUSPECT_DATA_PAGE
ObjectIdEXCHANGE_SPILL_EVENTEXCHANGE_SPILL_EVENT
ObjectIdHASH_WARNINGHASH_WARNING
ObjectIdLOCK_DEADLOCKLOCK_DEADLOCK
ObjectIdLOCK_DEADLOCK_CHAINLOCK_DEADLOCK_CHAIN
ObjectIdLOCK_ESCALATIONLOCK_ESCALATION
ObjectIdSQL_STMTRECOMPILESQL_STMTRECOMPILE
ObjectIdTRACE_FILE_CLOSETRACE_FILE_CLOSE
ObjectIdTRC_DEPRECATIONTRC_DEPRECATION
ObjectIdTRC_FULL_TEXTTRC_FULL_TEXT
ObjectIdTRC_OBJECTSTRC_OBJECTS
ObjectIdTRC_PERFORMANCETRC_PERFORMANCE
ObjectIdTRC_STORED_PROCEDURESTRC_STORED_PROCEDURES

Code samples for ObjectId property

The class SHOWPLAN_XML_FOR_QUERY_COMPILE is abstract and serves only as a base for new classes.

Get a Class as object

Short VB Script code to get the abstract class SHOWPLAN_XML_FOR_QUERY_COMPILE.
See in another language: C#, VB.Net.
'https://wutils.com/wmi/
Dim wmiClass, oProperty
Set wmiClass = GetObject( _
 "WINMGMTS:\\.\ROOT\Microsoft\SqlServer\ServerEvents\MSSQLSERVER:" + _
 "SHOWPLAN_XML_FOR_QUERY_COMPILE")

'get some class property 
Wscript.Echo wmiClass.properties_("ObjectId").Origin 'or other property name, see properties

'Check if the class is singleton
Wscript.Echo wmiClass.Path_.IsSingleton

'Get number of methods in the class
Wscript.Echo wmiClass.Methods_.Count

'List class properties
For Each oProperty In wmiClass.properties_
	'get property name and origin. Property value in the class is null, of course.
	Wscript.Echo oProperty.Name, oProperty.Origin, oProperty.Value
Next 

InstancesOf

List of all instances, wmi class SHOWPLAN_XML_FOR_QUERY_COMPILE.
'https://wutils.com/wmi/
Dim oWMI, Instances, Instance

'Get base WMI object, "." means computer name (local)
Set oWMI = GetObject("WINMGMTS:\\.\ROOT\Microsoft\SqlServer\ServerEvents\MSSQLSERVER")

'Get instances of SHOWPLAN_XML_FOR_QUERY_COMPILE - all instances of this class and derived classes 
Set Instances = oWMI.InstancesOf("SHOWPLAN_XML_FOR_QUERY_COMPILE")


'Enumerate instances  
For Each Instance In Instances 
  'Do something with the instance
  Wscript.Echo Instance.ObjectId 'or other property name
Next 'Instance
comments powered by Disqus
WUtils.com