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
Click Start, point to Programs, point to Microsoft Commerce Server 2002, and then click Software Development Kit.
Navigate to the CreateSchemaObject.vbs file, located at <drive>:\Program Files\Microsoft Commerce Server 2002\SDK\Samples\Business Analytics\Scripts\CreateSchemaObject.vbs.
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.
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"
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.)
Click Start, point to Programs, point to Accessories, and then click Command Prompt.
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
- Run the Schema Tool. For more information about the Schema Tool, see Schema Tool.
- 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
Extending the Data Warehouse Logical Schema
Copyright © 2005 Microsoft Corporation.
All rights reserved.