Share via


M.exe Command Line Reference

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

The Microsoft code name “M” Compiler, M.exe, performs several functions. It validates the accuracy of “M” code by providing errors and warnings. It also provides options to translate the “M” models into a data model for SQL Server 2008. You can optionally create an “M” image file. Mx.exe loads image files into the database. For more information, see Using "M" Tools for Data Modeling. M.exe also compile MGrammar files (.mg) that are used when creating a Domain Specific Language (DSL).

“M” Compiler Usage

To use the “M” compiler, specify the target “M” source files for compilation and then specify additional command-line parameters. The following example compiles two “M” files, named Model1.m and Model2.m. After listing the “M” files, the target option instructs the compiler to use a target of TSql10.

m.exe Model1.m Model2.m -target:TSql10

You can use wildcards for the input “M” files. The following example compiles all “M” files in the current directory.

m.exe *.m -target:TSql10

For more information about compilation scenarios, see Compiling "M" Files.

Command-Line Parameter Reference

The following table lists the command-line parameter options for the “M” compiler.

Option Alias Description

name:

n

Name to include in an image file’s manifest. This defaults to the name of the image file without the extension. Note that this is not a file name.

target:

t

Target type. Values include None, TSql10, and Edm. (Default = TSql10)

package:

p

Package type. Values include Image and Script. (Default = Image)

nocatalog:

nc

Turns off the generation of “M” language catalog entries in the target database.

catalogdefinition:

catdef

Creates an “M” catalog image file. By default this is off. With this option and the out option, you can generate an image file (.mx) that can create the “M” language catalog (m.exe -catalogdefinition -out:catalog.mx).

out:

o

Output file name. When more than one package type is specified with the package option, use a comma-separated list of output file names to correspond to each package type in the same order. Use the "-" to output to the console (not valid with an Image package type). The file name defaults to the name of the “M” input file. The default file type is a SQL script file (.sql) for the Script package type or an image file (.mx) for the Image package type.

featureversion:

fv

Feature version to include in the image file’s manifest (valid values are non-zero positive integers). (Default = 1)

servicingversion:

sv

A servicing version to include in the image file’s manifest. This must be a non-negative integer. (Default = 0)

reference:

r

One or more comma-separated image files used to resolve external references.

resource:

res

One or more comma-separated files to embed in the image file.

recurse:

recurse

One or more comma-separated wild-card specifications. Use to include all files in the current directory and all subdirectories according to the specified patterns.

presql:

prs

Specifies a T-SQL script file to embed in a compiled image. When the image file loads into a target database, this script runs first.

postsql:

pos

Specifies a T-SQL script file to embed in a compiled image. This script runs after the image file finishes loading into a target database.

reportConflicts

rc

Reports build warnings for any syntactic conflicts that occur during parser generation for MGrammar constructs.

conflictlogfile:

cl

Specifies a log file for recording any syntactic conflicts that occur during parser generation for MGrammar constructs. The information in this log file is more detailed than the warnings produced by the reportConflicts option.

define:

d

Symbol used in conditional compilations. For example -define:DEBUG.

nowarn:

nw

Ignores one or more comma-separated warning numbers.

nodeprecationwarnings

nd

Ignore all deprecation warnings.

warnaserror

w

Treats all warnings as errors.

warnaserrors:

ws

Treats one or more comma-separated warning numbers as errors.

verbose

v

Displays verbose output.

printreport

printreport

Prints a compilation report.

codepage:

codepage

Integer value of the codepage to use when opening source files. Valid values range from 0 to 65535. (Default = 0)

semanticAnalysisThreshold:

semanticAnalysisThreshold

Specifies the number of times the compiler will iterate while type checking MSchema constructs. This is an advanced option. (Default = 1)

nostandardlibrary

nostdlib

Removes the standard library from the compilation. Any references to items from the standard library will fail.

nologo

nologo

Suppresses the compiler logo.

pragma:

pragma

A list of compiler directives.

bootstrap:

boot

Indicates the use of bootstrapping. Possible values include true and false.

requireReferencesToContainImages:

requireReferencesToContainImages

When set to false, ignores references that are not contained in images. Possible values include true and false.

saveStdLibAst:

saveStdLibAst

loadStdLibSource

loadStdLibSource

?

?

Displays command-line help information.

@<file>

@<file>

Read <file> for more parameters. For example, if the compiler parameters were contained in the file params.txt, you could pass this file to the compiler with the following command: m.exe @params.txt.

See Also

Other Resources

"M" Tools