Modifying the Resource Schema Tables

When a new resource is added for management within Commerce Server Manager it is necessary to add new rows to the SystemProps and ExtendedProps tables in the Administration database (MSCS_Admin). New rows in the SystemProps table correspond to new resources. New rows in the ExtendedProps table correspond to properties associated with the new resources.

For more information about the columns of the SystemProps and ExtendedProps tables, see SystemProps Table and ExtendedProps Table, respectively.

The Site Status sample in the Commerce Server 2000 Software Development Kit (SDK) includes a pair of files that show one way to add a row representing a new resource to the SystemProps table. The file SiteStatusInit.sql includes the following SQL command, which inserts a new row and initializes the required column values (lines wrapped here for readability):

IF NOT EXISTS(SELECT s_ClassName FROM SystemProps
              WHERE s_ClassName = 'MSCS_SDKSiteStatus')
insert into SystemProps (s_Name, s_ClassName,
                         s_ResourceType, f_ResourceFlags,
                         f_PupFlags, s_ProgIDSnapin)
                  VALUES('', 'MSCS_SDKSiteStatus',
                         'SDKSiteStatus', 6,
                         0, 'CommerceSDK.SiteStatus')

The file InstallSiteStatus.vbs provides an example of one way to run the previous SQL command:

Dim WshShell
Set WshShell = Wscript.CreateObject("Wscript.Shell")
sCmdLine = "osql /S (local) /U sa /P /d MSCS_Admin /i SiteStatusInit.sql"
WshShell.Run sCmdLine, 1, True

The file SiteStatusInit.sql in the Site Status sample in the SDK also includes several SQL commands for adding property schema information to the ExtendedProps table. The following code excerpt shows one of the three properties added in this file (lines wrapped here for readability):

IF NOT EXISTS(SELECT s_PropertyName FROM ExtendedProps
              WHERE s_PropertyName = 's_AppName')
insert into ExtendedProps VALUES ('SDKSiteStatus', 's_AppName',
                                  0, 1, 0,
                                  'SDK SiteStatus Application Name',
                                  8200, '', 's_AppName')


All rights reserved.