Create Schema Object Script

Location in SDK: SDK\Samples\Business Analytics\Scripts\CreateSchemaObject.vbs

This sample demonstrates how to use the OLE DB Provider for Commerce Server to modify the Business Analytics System logical schema by adding new classes and class members, and associating them with existing classes. When run, the sample script creates five new sample classes in the Data Warehouse.

For more information about extending the logical schema of the Data Warehouse, see Extending the Logical Schema of the Data Warehouse.

To run the Create Schema Object script

To view the classes created by CreateSchemaObject.vbs

To run the Create Schema Object script

  1. Click Start, point to Programs, point to Microsoft Commerce Server 2002, and then click Software Development Kit.

  2. Navigate to the CreateSchemaObject.vbs file, located at <drive>:\Program Files\Microsoft Commerce Server 2002\SDK\Samples\Business Analytics\Scripts\CreateSchemaObject.vbs.

  3. Right-click the CreateSchemaObject.vbs icon, point to Open With, and then select your preferred text editor. In this example, Notepad is used as the text editor.

  4. On lines 133 and 134 of the CreateSchemaObject.vbs code, modify the connection string and the URL string to match the settings for the Data Warehouse to which the test classes are to be added. Substitute actual values for those values shown in bold font. In this sample a trusted connection is used instead of passing the username and password.

    strSQLConn = "PROVIDER=SQLOLEDB;SERVER=servername;database=dbname; _
    Integrated Security='SSPI';" 
    strURL = "URL=mscop://InProcConnect/Server=servername: _
    database=dbname:catalog=DWSchema:Trusted_Connection=Yes: _
    FASTLOAD=True"
    
  5. After modifying the property values, save the file. On the File menu, click Save. (You can also close the file and text editor at this point.)

  6. Click Start, point to Programs, point to Accessories, and then click Command Prompt.

  7. In the Command prompt screen, use the cscript program to run the modified script by typing cscript, a space, and the full path to the CreateSchemaObject.vbs file, and then press ENTER. For example:

    C:\>cscript "D:\Program Files\Microsoft Commerce Server\SDK\Samples\Business Analytics\Scripts\CreateSchemaObject.vbs"
    

The Command prompt screen shows the status of the script as new classes are created.

To view the classes created by CreateSchemaObject.vbs

  1. Run the Schema Tool. For more information about the Schema Tool, see Schema Tool.
  2. In the left pane of the screen, in the class list, the new classes are listed. The new classes are MyClassX, MyParentX, StudentX, StudentEnrolledX, and TestMVX, where X signifies a ten-digit unique identifier for the set of new classes.

See Also

Schema Reference

Extending the Data Warehouse

Extending the Data Warehouse Logical Schema

Copyright © 2005 Microsoft Corporation.
All rights reserved.