Microsoft KB Archive/307942

= How To Generate Profile Scripts to Be Used During Unpackaging =

Article ID: 307942

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Commerce Server 2000 Standard Edition

-



This article was previously published under Q307942



IN THIS TASK
 SUMMARY

Packing Extended Profile Schema

Determining Which Tables to Script

 REFERENCES



SUMMARY
This step-by-step article describes how to generate profile schema scripts to be used during the unpackaging process by the profile system.

back to the top

Packing Extended Profile Schema
If you want to create a package that contains an extended profile schema, you need to generate the script before you package your site. The following steps outline how to package an extended profile schema:  Use Microsoft SQL Server Enterprise Manager to extend the UserObject table and add your own attributes. For more information, see the SQL Server documentation. Add the new data members to the data object. For information about how to add a new data member, see the following Microsoft Web site:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/comsrv2k/htm/cs_mmc_datamapper_mlbc.asp

 Use SQL Server Enterprise Manager to generate scripts for your extended profile schema. For more information, see the SQL Server documentation. When you package your site, Site Packager prompts you to specify the location of the schema definition script that you generated. If you do not specify your script, Site Packager packages the default script, which does not include your extension.</li></ol>

NOTES:
 * If you are using the default profile schema (SQL Server or Active Directory), scripted SQL files have already been created, which are located in the \Program Files\Microsoft Commerce Server\ folder. If you are using SQL Server, the file is named ProfileSQL.sql. If you are using Active Directory, the file is named ProfileAD.sql.
 * If you back up and restore the entire database, the schema remains intact; therefore, when you are prompted for the profile schema scripts (during the packaging process), leave them blank and continue. When this field is blank, none of the tables (and so forth), which already exist in the restored database, are re-created during the unpackaging process; however, if you specify an incorrect script, the profile system schema and data may be overwritten or otherwise damaged.

back to the top

Determining Which Tables to Script
Depending on the extent of customization that exists on your Commerce Server 2000 profile system, you may need to script additional tables other than the default UserObject table.

To determine which tables need to be scripted: <ol> Start the Commerce Server Microsoft Management Console (MMC).</li> In the Commerce Server Manager snap-in, click Global Resources.</li> Locate the Profiles global resource for your Commerce store. For example, by default, the Profiles global resource for the Retail solution site is displayed as:

Profiles( _Retail_Commerce)

</li> Click the Profiles global resource, click Profile Catalog, and then click Data Sources.</li> Each object that is displayed directly under Data Sources is either an LDAPv3 (possibly Active Directory) data source or an OLE DB data source. By default, the data source of the Retail solution site is ProfileService_SQLSource.</li> Right-click a data source, and then click Properties. On the Data Source tab, note whether the source is LDAPv3 or OLE DB; you only need to script the OLE DB data sources.

Repeat this step for each data source.</li> After you locate all of the OLE DB data sources, you need to determine to which database each data source is bound: <ol style="list-style-type: lower-alpha;"> Right-click the OLE DB data source, and then click Properties.</li> On the Partitions tab, select a partition, and then click Edit. Note the initial catalog (which is the database) and data source (which is the database server).

Repeat step a and step b for each partition that is listed.</li></ol> </li> Now that you know the name of the databases and database servers, you need to determine which tables to script in each database: <ol style="list-style-type: lower-alpha;"> Click Data Source, and then click Data Objects.

NOTE: Data objects are tables that are exposed to the Profile system.</li> In the details pane, a list of the exposed tables is displayed; note the Name column where each name that is listed is a table name.

Repeat step a and step b for each data source that is listed.</li></ol> </li> With the names of the databases, the database servers, and the tables that are in each database, you can script the profile system. For information about how to generate SQL scripts, refer to the SQL Books Online.

NOTES:  You may require assistance from your SQL administrator for this procedure.</li> <li>If more than one data source is used, be sure to combine the scripts from each data source together.</li> <li>In the master SQL script, be sure to correctly identify which data source you are using and during which time you are using it.</li></ul> </li></ol>

back to the top