Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

Note that some planning and an understanding of database updates in wide and narrow tables is required to successfully take full advantage of this feature.

Row Size Limit

The row size limit of 8060 bytes was a hard limit for versions earlier than SQL Server 2005. Attempts to save a record whose size exceeded this limit resulted in an error. With SQL Server 2005 and later, the server can automatically handle situations where the row size exceeds the 8060 bytes without generating the error. However, replication still requires adherence to the 8060-byte limit, so any entity that you intend to replicate must have a maximum row size that is less than the limit. Also, in any case, Aptify recommends designing tables that are less than the 8060-byte limit to ensure optimum performance.

...

Table Size Warning -Message
Keep in mind that even if you receive the warning message that the table's row size may exceed the 8060-byte limit, a row will only reach this maximum size if a user enters the maximum number of characters for variable length fields. For example, if you have an nvarchar(4000) field in your entity, Aptify will use 8000 bytes for this field when calculating the maximum row size. However, this field will only actually use 8000 bytes if a user enters 4000 characters, which may be unlikely depending on the nature of the field. Also, Aptify supports the nvarchar(max) and varchar(max) data types. In general, you should use one of these data types for fields that can contain large amounts of data. Also, the likelihood of approaching the table size limit is reduced dramatically if you use these max data types in place of large nvarchar or varchar data types. See nvarchar(max) and varchar(max) for more information on these data types.

Creating Multiple Base Tables

If you are creating a complex entity with a large number of fields or if Aptify has warned you that your the row size may exceed the 8060-byte limit, you can add additional base tables to your entity.
Follow these steps to add another table to your entity:

  1. Open a new or existing Entities record.
  2. Click the plus (+) sign to the right of the Base Table field to open the Additional Base Table dialog.

    Adding a Base Table
  3. Click the new icon to open a new Additional Base Tables record.
  4. Enter a name for the new table in the Table field.
    • The table's name cannot contain spaces or be a SQL reserved word. See the Microsoft SQL Server Books Online for more information on the naming restrictions for tables and other identifiers.
    • Aptify recommends that your table name contain the name of the entity's primary base table and a description of the fields that it will contain, for example, SampleServiceDetailTab.

  5. If applicable, select an alternate filegroup in the File Group field and click OK.
    • Note that the Text/Image File Group field is disabled since no qualifying fields with text or image data types have been added to the table as of yet.
    • See Creating Multiple Filegroups for more information about filegroups.

      Specifying a New Table Name and File Group

  6. Add additional tables as necessary.
    • Alternatively, you can click OK and New in Step 5 to save the current record and open a new Additional Base Tables record in one step.

  7. Click Close to close the Additional Base Tables dialog and return to the Entities record.
  8. Assign one or more fields to the new table. See Defining Entity Fields for details.
  9. Save and close the Entities record.

...

  • The ID field must reside in the main base table.
  • Each record in an entity spans all of the entity's tables. Each table has an ID field. For each record, the ID field is the same value for all of the entity's tables. This links the tables together to form a single record.
  • Any field that links back to a parent ID field, such as in a sub-type entity, must reside in the main base table. See Creating Multiple Filegroups for more information on sub-types.
  • A computed field and all of the fields that are referenced in its calculation must be in the entity's primary base table. See Calculated and Computed Virtual Fields for details.
  • When adding a new field, you can assign it to any of the entity's base tables (keeping in mind the restrictions listed above).
  • After you have saved a field in one table, you can move it to another table, if necessary (keeping in mind the restrictions listed above). Follow these steps to change a field's table assignment:

...