Parameter: system_addconstraint

Startup parameters change the behavior of the Service Manager server. You can always set a startup parameter from the server's operating system command prompt.

Parameter

system_addconstraint

Description

The system_addconstraint parameter adds a Not Null constraint to the first unique key or converts the unique key to a primary key for the specified database tables, depending on usage. The system_addconstraint parameter takes the following two arguments:

  • The target tables: Specify "all" to update all tables or specify a list of tables separated by commas. If no tables are specified, running this command will do nothing but bring up the parameter help.

  • Behavior: 

    • 0 adds a "Not Null" constraint on the first unique key of the specified tables (if no unique key or primary key exists, Service Manager adds the constraint to the RECORD_KEY field).

    • 1 converts the first unique key of the specified tables to primary keys (if there is no unique or primary key, Service Manager converts the RECORD_KEYfield to primary key) .

    • 2 converts the first unique key of the specified tables to primary keys by using the full-table copy mechanism. Running this command may take a very long time.

    Note This parameter can only be set from an operating system command prompt.

Valid if set from

Server's operating system command prompt

Requires restart of the Service Manager server?

You should run this command only when the Service Manager server is shutdown.

Default value

0 (By default, this parameter does nothing.)

Possible values

all:0 - Adds a "Not Null" constraint to the first unique key of all tables in the system.

all:1 - Converts the first unique key of all tables in the system to a primary key.

all:2 - Force a full table copy to convert the first unique key of all tables to a primary key in case you cannot convert the first unique key to a primary key in an MS SQL Server database.

[A comma separated list of tables]:0 - Adds a "Not Null" constraint only to the first unique key of the specified tables.

[A comma separated list of tables]:1 - Converts the first unique key of the specified tables to primary keys.

[A comma separated list of tables]:2 - Converts the first unique key of the specified tables to primary keys by using the full-table copy mechanism. Running this command may take a very long time..

Example usage

Command line: sm -system_addconstraint:all:1
Command line: sm -system_addconstraint:probsummary,incidents:0
Command line: sm -system_addconstraint:operator:2

Related topics

System parameters

Working with primary keys
Enter a parameter in the sm.ini file