Object properties can be divided into two main groups:
- alphanumeric properties (for example object comments or business functions).
- numeric properties (for example the number of inner comment lines, number of code lines etc.).
These can all be removed using the CAST entry table CI_NO_PROPERTIES. Properties are listed in the CAST System View CTV_OBJECT_PROPERTIES.
Based on object's ID
In this example, we are going to remove a property from an SQL object (a Procedure called "GetTitleAuthors") in the CAST Analysis Service. The property we are going to remove is the Source Code Comments, which is described in the Analysis Service as "sourceCodeComment".
You can check the value for this property by querying a CAST System View:
select PROP_DESCRIPTION, VALUE from CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'GetTitleAuthors' and PROP_NAME = ' sourceCodeComment '
The result that is returned shows the value:
PROP_DESCRIPTION VALUE [char] [char] ----------------------------------- Source Code Comments variable declaration Source Code Comments code Source Code Comments If this procedure is not called from another one, Raise an error Source Code Comments return the error value
You can also see object properties in CAST Enlighten by placing the object in a view and then selecting the object and using the F12 key.
The next step is to insert the data into the CAST entry tables that will cause the property in question to be removed from the Analysis Service when the tool is run. Add a new Update CAST Knowledge Base Tool and enter the following query:
insert into <KB_name>.dbo.CI_NO_PROPERTIES (OBJECT_ID, PROP_NAME, ERROR_ID) select OBJECT_ID, 'BodyCommentLinesCount', 0 from <KB_name>.dbo.CTV_GUID_OBJECTS where OBJECT_NAME = 'GetTitleAuthors ' go
- The 0 parameter will enter 0 in the ERROR_ID column of the tables in question.
- Note that you need to specify the Analysis Service database and user as above "<KB_name>.dbo" otherwise the query will fail when the job is run.
- You can also use variables to replace the Analysis Service name if required. See the on-line Help for the CAST Management Studio for more information.
Then:
- Complete the configuration of the job and run it as outlined in Using the Update CAST Knowledge Base Tool.
- Make sure you then update the CAST System Views.
If you want to check that the property has indeed been removed successfully, you can use the following query in an SQL IDE against your Analysis Service (adapting it for your environment):
select PROP_DESCRIPTION, VALUE from CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'GetTitleAuthors ' and PROP_NAME = 'BodyCommentLinesCount'
The result returns 0 for this OBJECT_NAME:
PROP_DESCRIPTION VALUE [char] [char] ----------------------------------- This transaction returns no row.
You can also check in CAST Enlighten.
Based on object's GUID
From an object with an OBJECT_GUID
In this example, we are going to remove a property from a C++ object (a Function called "print_header ()") in the CAST Analysis Service. The property we are going to remove is the Number of inner comment lines, which is described in the Analysis Service as "BodyCommentLinesCount".
You can check the value for this property by querying a CAST System View:
select PROP_DESCRIPTION, VALUE from CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'print_header ()' and PROP_NAME = 'BodyCommentLinesCount'
The result that is returned shows the value 11:
PROP_DESCRIPTION VALUE [char] [char] Number of inner comment lines 11
You can also see object properties in CAST Enlighten by placing the object in a view and then selecting the object and using the F12 key.
The next step is to insert the data into the CAST entry tables that will cause the property in question to be removed from the Analysis Service when the tool is run. Add a new Update CAST Knowledge Base Tool and enter the following query:
insert into <KB_name>.dbo.CI_NO_PROPERTIES (OBJECT_GUID, PROP_NAME, ERROR_ID) select OBJECT_GUID, PROP_NAME, 0 from <KB_name>.dbo.CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'print_header ()' and PROP_NAME = 'BodyCommentLinesCount' go
- The 0 parameter will enter 0 in the ERROR_ID column of the tables in question.
- Note that you need to specify the Analysis Service database and user as above "<KB_name>.dbo" otherwise the query will fail when the job is run.
- You can also use variables to replace the Analysis Service name if required. See the on-line Help for the CAST Management Studio for more information.
Then:
- Complete the configuration of the job and run it as outlined in Using the Update CAST Knowledge Base Tool.
- Make sure you then update the CAST System Views.
If you want to check that the property has indeed been removed successfully, you can use the following query in an SQL IDE against your Analysis Service (adapting it for your environment):
select PROP_DESCRIPTION, VALUE from CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'print_header ()' and PROP_NAME = 'BodyCommentLinesCount'
The result returns 0 for this OBJECT_NAME:
PROP_DESCRIPTION VALUE [char] [char] ----------------------------------- This transaction returns no row.
You can also check in CAST Enlighten.
From an object without an OBJECT_GUID
In this example, we are going to remove a property from a T-SQL server object (a stored procedure called "GetAuthors") in the CAST Analysis Service. The property we are going to remove is the Number of code lines, which is described in the Analysis Service as "CodeLinesCount".
You can check the value for this property by querying a CAST System View:
select PROP_DESCRIPTION, VALUE from CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'GetAuthors' and PROP_NAME = 'CodeLinesCount'
The result that is returned shows the value 13:
PROP_DESCRIPTION VALUE [char] [char] ----------------------------------- Number of code lines 13
You can also see object properties in CAST Enlighten by placing the object in a view and then selecting the object and using the F12 key.
The next step is to insert the data into the CAST entry tables that will cause the property in question to be removed from the Analysis Service and create an OBJECT_GUID for the object in question when the tool is run. Add a new Update CAST Knowledge Base Tool and enter the following query:
insert into <KB_name>.dbo.GUID_OBJECTS (OBJECT_ID, OBJECT_GUID, ERROR_ID) select OBJECT_ID, OBJECT_NAME, 0 from <KB_name>.dbo.CTV_GUID_OBJECTS where OBJECT_NAME = 'GetAuthors' go insert into <KB_name>.dbo.CI_NO_PROPERTIES (OBJECT_GUID, PROP_NAME, ERROR_ID) select OBJECT_NAME, PROP_NAME, 0 from <KB_name>.dbo.CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'GetAuthors' and PROP_NAME = 'CodeLinesCount' go
This is in effect two queries:
- The first inserts the object's OBJECT_ID and OBJECT_NAME into the GUID_OBJECTS table to create a correspondence.
- The second inserts the data in the CI_NO_PROPERTIES table to remove the property.
- The 0 parameter will enter 0 in the ERROR_ID column of the tables in question.
- Note that you need to specify the Analysis Service database and user as above "<KB_name>.dbo" otherwise the query will fail when the job is run.
- You can also use variables to replace the Analysis Service name if required. See the on-line Help for the CAST Management Studio for more information.
- Please see Creating OBJECT_GUIDs for more information about creating OBJECT_GUIDs for objects that do not have them.
Then:
- Complete the configuration of the job and run it as outlined in Using the Update CAST Knowledge Base Tool.
- Make sure you then update the CAST System Views.
If you want to check that the property has indeed been removed successfully, you can use the following query in an SQL IDE against your Analysis Service (adapting it for your environment):
select PROP_DESCRIPTION, VALUE from CTV_OBJECT_PROPERTIES where OBJECT_NAME = 'GetAuthors' and PROP_NAME = 'CodeLinesCount'
The result returns 0 for this OBJECT_NAME:
PROP_DESCRIPTION VALUE [char] [char] ----------------------------------- This transaction returns no row.
You can also check in CAST Enlighten.