spMFCreateAllMFTables

Signature

EXEC dbo.spMFCreateAllMFTables
    @IncludedInApp = 1,
    @Debug = 0;
Returns
  • 1 = Success

  • -1 = Error

Parameters
@IncludedInApp int
  • Default = 1

  • Creates the tables of the classes whose MFClass.IncludeInApp equals this value

@Debug smallint (optional)
  • Default = 0

  • 1 = Standard Debug Mode

Purpose

Create all Class Tables for IncludedinApp = 1 by default, or as set in the @IncludedInApp parameter

The procedure calls spMFCreateTable for each matching class whose table does not exist yet; existing tables are left as they are. Each table gets its columns from MFClassProperty, including the rows with IsAdditional = 1 (see spMFCreateTable).

This is the bulk path for an installation with many class tables: set MFClass.IncludeInApp on the classes, create the tables with this procedure, then load them with spMFUpdateAllncludedInAppTables.

Examples

EXEC [spMFCreateAllMFTables]

UPDATE mc
SET [mc].[IncludeInApp] = 4
FROM MFclass mc
INNER JOIN MFObjectType mo
ON [mo].[ID] = [mc].[MFObjectType_ID]
WHERE mo.name = 'Document' AND [mc].[IncludeInApp] IS NULL

EXEC dbo.spMFCreateAllMFTables @IncludedInApp = 4;

Set IncludeInApp by class name, create the tables, then load them

UPDATE dbo.MFClass
SET IncludeInApp = 1
WHERE Name IN (N'Customer', N'Purchase Invoice');

EXEC dbo.spMFCreateAllMFTables @IncludedInApp = 1;

DECLARE @ProcessBatch_ID INT;
EXEC dbo.spMFUpdateAllncludedInAppTables @IncludeClass = N'1',
                                         @IsIncremental = 0,
                                         @ProcessBatch_ID = @ProcessBatch_ID OUTPUT;

Changelog

Date

Author

Description

2026-11-16

AC

Correct the second example; document the bulk path and existing tables

2019-09-26

LC

Add parameter to allow for setting up custom list for creating tables

2019-08-30

JC

Added documentation

2016-04-01

DEV2

Create procedure