Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Table of Contents Database object (TMSL) DataSources object (TMSL) Model object (TMSL) Partitions object (TMSL) Relationships object (TMSL) Roles object (TMSL) Tables object (TMSL) TMSL Reference - Tabular Objects Database object (TMSL) 5/10/2017 • 1 min to read • Edit Online Defines a Tabular database at compatibility level 1200 or higher, based on a model of the same level. This topic documents the object definition of a database, providing the payload for requests that create, alter, delete, and perform database management tasks. NOTE In any script, only one database at the time can be referenced. For any object other than database itself, the Database property is optional if you specify the model. There is one-to-one mapping between a Model and a Database that can be used to deduce the Database name if it's not explicitly provided. Similarly, you can leave out Model, setting its properties on the Database. Object definition All objects have a common set of properties, including name, type, description, a properties collection, and annotations. Database objects also have the following properties. compatibilitylevel Currently, valid values are 1200, 1400. Lower compatibility levels use a different metadata engine. readwritemode Enumerates the mode of the database. It's common to make a database read-only in high availability or scalability configurations. Valid values include readWrite, readOnly, or readOnlyExclusive. See High availability and Scalability in Analysis Services and Switch an Analysis Services database between ReadOnly and ReadWrite modes for more information about when this property is used. Usage Database objects are used in almost every command. See Commands in Tabular Model Scripting Language (TMSL) for a list. A Database object is a child of a Server object. When creating, replacing, or altering a database object, specify all read-write properties of the object definition. Omission of a read-write property is considered a deletion. Partial Syntax Because this object definition is so large, only direct properties are listed. The Model object provides the bulk of the database definition. See Model object (TMSL) to how the object is defined. "database": { "type": "object", "properties": { "name": { "type": "string" }, "id": { "type": "string" }, "description": { "type": "string" }, "compatibilityLevel": { "type": "integer" }, "readWriteMode": { "enum": [ "readWrite", "readOnly", "readOnlyExclusive" ] }, "model": { "type": "object", ... } } See Also Tabular Model Scripting Language (TMSL) Reference High availability and Scalability in Analysis Services DataSources object (TMSL) 3/24/2017 • 3 min to read • Edit Online Defines a connection to a data source used by the model either during import to add data to the model, or in pass through queries via DirectQuery mode. Models in DirectQuery mode can only have one DataSource object. Unless you are creating, replacing, or altering the data source object itself, any data source referenced in your script (such as in partition script) must be an existing DataSource object in your model. Object definition All objects have a common set of properties, including name, type, description, a properties collection, and annotations. DataSource objects also have the following properties. type The type of DataSource. At present, the only valid value is Provider (1) - Normal connection string. connectionString The connection string that minimally specifies the server and database, but can also include other properties supported by the external RDBMS, such as a data provider or user account. This value is required. See SqlConnectionStringBuilder Class for details about SQL Server database connection string properties. impersonationMode Specifies whether Analysis Services should impersonate the identity of the user requesting the query. This property is a numeric value that specifies the credentials to use for impersonation. The enumeration values are as follows: Default (1) - The server uses the impersonation method that it deems to be appropriate for the context in which impersonation is used. ImpersonateAccount (2) - The server uses the specified user account. ImpersonateAnonymous (3) - The server uses the anonymous user account. This option is not recommended, but is sometimes used in HTTP access scenarios by custom applications that handle authentication. ImpersonateCurrentUser (4) - The server uses the user account that the client is connecting as. ImpersonateServiceAccount (5) - The server uses the user account that the server is running as. ImpersonateUnattendedAccount (6) – The server uses an unattended user account. This is used for Power Pivot or Tabular models that run in a SharePoint environment. DirectQuery mode can use impersonateCurrentuser if Analysis Services is configured for trusted delegation, or impersonateServiceAccount if the query request is made in the security context of the Analysis Services service account. See Configure Analysis Services for Kerberos constrained delegation. account Used for impersonation. A Windows or database account that has a valid login with read permissions on the external database. password An encrypted string providing the password of the account. maxConnections The maximum number of connections to be opened concurrently to the data source. isolation The kind of isolation that is used when executing commands against the data source. Valid values are ReadCommitted (1) or Snapshot (2). timeout An integer that specifies the timeout in seconds for commands executed against the data source. provider An optional string that identifies the name of the managed data provider used on the connection to the relational database, if not otherwise specified on the connection string. Usage DataSource objects are used in Alter command (TMSL), Create command (TMSL), CreateOrReplace command (TMSL), Delete command (TMSL), Refresh command (TMSL), and MergePartitions command (TMSL). A DataSource object is a property of a Model, but can also be specified as a property of a Database object given the one-to-one mapping between Model and Database. Partitions based on SQL queries also specify a DataSource, only with a reduced set of properties. When creating, replacing, or altering a data source object, specify all read-write properties of the object definition. Omission of a read-write property is considered a deletion. Examples Example 1 - a connection to a FoodMart database on a remote named instance of Sales on a network server named Server01. "dataSources": [ { "name": "SqlServer Server01 FoodMart", "connectionString": "Provider=SQLNCLI11;Data Source=Server01\Sales;Initial Catalog=Foodmart;Integrated Security=SSPI;Persist Security Info=false", "impersonationMode": "impersonateServiceAccount", } ] Full Syntax Below is the schema representation of a data source object of a model. "dataSources": { "type": "array", "items": { "anyOf": [ { "description": "ProviderDataSource object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "type": { "enum": [ "provider" "provider" ] }, "connectionString": { "type": "string" }, "impersonationMode": { "enum": [ "default", "impersonateAccount", "impersonateAnonymous", "impersonateCurrentUser", "impersonateServiceAccount", "impersonateUnattendedAccount" ] }, "account": { "type": "string" }, "password": { "type": "string" }, "maxConnections": { "type": "integer" }, "isolation": { "enum": [ "readCommitted", "snapshot" ] }, "timeout": { "type": "integer" }, "provider": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false } ] } }, See Also Tabular Model Scripting Language (TMSL) Reference DirectQuery Mode (SSAS Tabular) Configure HTTP Access to Analysis Services on Internet Information Services (IIS) 8.0 Model object (TMSL) 5/10/2017 • 2 min to read • Edit Online Defines a Tabular model. There is one model per database, and only one database that can be specified in any given command. A Database object is the parent object. Model definitions are too large to reproduce the entire syntax in one topic. For this reason, a partial syntax highlighting the main parts can be found below, with links to child objects. Perhaps the best way to understand a model definition is to start with a Tabular model that you know well. Use the View Code option in SQL Server Data Tools to view its definition. Remember to install a JSON editor so that you can view the code. You can get a JSON editor in Visual Studio by downloading the Community edition or other edition of Visual Studio. NOTE In any script, only one database at the time can be referenced. For any object other than database itself, the Database property is optional if you specify the model. There is one-to-one mapping between a Model and a Database that can be used to deduce the Database name if it's not explicitly provided. Similarly, you can leave out Model, setting its properties on the Database. Object definition All objects have a common set of properties, including name, type, description, a properties collection, and annotations. Model objects also have the following properties. storageLocation The location on disk to place the model. defaultMode The default method for making data available in the partition. defaultDataView For models in DirectQuery mode, this property determines which partitions are used to run queries against the model. Valid values include Full and Sample. culture The culture to use for formatting. collation The collation sequence. See Globalization scenarios for Analysis Services for more information. tables The full collection of tables in the model, including partitions, columns, measures, KPIs, and annotations. See Tables object (TMSL) for details. relationships Specifies the relationship between each pair of tables, including properties that set filter direction and security. See Relationships object (TMSL) for details. dataSources One or more connections to external databases providing data to the model or used for pass through queries. See DataSources object (TMSL) for details. roles Objects that associate a database permission, member accounts, and optionally, security filters in DAX for custom access control. Usage Model objects contain an entire model. You need to specify either one Model and/or its parent Database object in most commands. When creating, replacing, or altering a model object, specify all read-write properties of the object definition. Omission of a read-write property is considered a deletion. Partial Syntax Because this object definition is so large, only the first level properties are listed. See Object Definitions in Tabular Model Scripting Language (TMSL) for a list of child objects. "model": { "description": "Model object of a Tabular database", "type": "object", "properties": { "name": { }, "description": { }, "storageLocation": { }, "defaultMode": { }, "defaultDataView": { }, "culture": { }, "collation": { }, "annotations": { }, "tables": { }, "relationships": { }, "dataSources": { }, "perspectives": { }, "cultures": { }, "roles": { } } See Also Tabular Model Scripting Language (TMSL) Reference Compatibility Level for Tabular models in Analysis Services Partitions object (TMSL) 3/24/2017 • 3 min to read • Edit Online Defines a partition, or logical segmentation, of the table rowset. A partition consists of a SQL query used for importing data, for sample data in the modeling environment, or as a full data query for pass through query execution via DirectQuery. Properties on the partition determine how the data is sourced for the table. In the object hierarchy, the parent object of a partition is a table object. Object definition All objects have a common set of properties, including name, type, description, a properties collection, and annotations. Partition objects also have the following properties. type The type of partition. Valid values are numeric, and include the following: Query (1) – data in this partition is retrieved by executing a query against a DataSource. The DataSource must be a data source defined in the model.bim file. Calculated (2) – data in this partition is populated by executing a calculated expression. None (3) – data in this partition is populated by pushing a rowset of data to the server as part of the Refresh operation. mode Defines the query mode of the partition. Valid values are import, DirectQuery, or default (inherited). This value is required. Import Indicates query requests are issued against the in-memory analytics engine storing imported data. DirectQuery Pass through query execution to an external relational database. DirectQuery mode uses partitions to provide sample data used during model design. When deployed on a production server, you should switch back to Full data view. Recall that DirectQuery mode requires one partition per table, and one data source per model. default Set this if you want to switch modes higher up the object tree, at the model or database level. When you choose default, the query mode will be either import or DirectQuery. source Identifies the location of the data to be queried. Valid values are query,calculated, or none. This value is required. none Used for import mode, where data is loaded and stored in memory. query For DirectQuery mode, this is a SQL query executed against the relational database specified in the model's DataSource. See DataSources object (TMSL). calculated Calculated tables are sourced from an expression specified when the table is created. This expression is considered the source of the partition created for the calculated table. dataview For DirectQuery partitions, an additional dataView property further specifies whether the query that retrieves data is a sample or the full dataset. Valid values are full, sample, or default (inherited). As noted, samples are used only during data modeling and testing. See Add sample data to a DirectQuery model in Design Mode for more information. Usage Partition objects are used in Alter command (TMSL), Create command (TMSL), CreateOrReplace command (TMSL), Delete command (TMSL), Refresh command (TMSL), and MergePartitions command (TMSL). When creating, replacing, or altering a partition object, specify all read-write properties of the object definition. Omission of a read-write property is considered a deletion. Read-write properties include name, description, mode, and source. Examples Example 1 - A simple partition structure of a table (not a fact table). "partitions": [ { "name": "Customer", "source": { "query": "SELECT [dbo].[Customer].* FROM [dbo].[Customer]", "dataSource": "SqlServer localhost FoodmartDB" } ] Example 2 - Partitioned fact data is typically based on a WHERE clause that creates non-overlapping partitions for data from the same table. "partitions": [ { "name": "sales_fact_2015", "source": { "query": "SELECT [dbo].[sales_fact_2015].* FROM [dbo].[sales_fact_2015] WHERE [dbo]. [sales_fact_2015].[Quarter]=4", "dataSource": "SqlServer localhost FoodmartDB" }, } ] Example 3 - A calculated table based on a DAX expression. "partitions": [ { "name": "CalcTable1", "source": { "type": "calculated", "expression": "'Product Class'" }, } ] Full Syntax Below is the schema representation of a partition object. "partitions": { "type": "array", "items": { "description": "Partition object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "mode": { "enum": [ "import", "directQuery", "default" ] }, "dataView": { "enum": [ "full", "sample", "default" ] }, "source": { "anyOf": [ { "description": "QueryPartitionSource object of Tabular Object Model (TOM)", "type": "object", "properties": { "type": { "enum": [ "query", "calculated", "none" ] }, "query": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "dataSource": { "type": "string" } }, "additionalProperties": false }, { "description": "CalculatedPartitionSource object of Tabular Object Model (TOM)", "type": "object", "properties": { "type": { "enum": [ "query", "calculated", "none" ] }, "expression": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } ] }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, }, "additionalProperties": false } } }, "additionalProperties": false } }, See Also Tabular Model Scripting Language (TMSL) Reference Relationships object (TMSL) 3/24/2017 • 2 min to read • Edit Online Defines a relationship between a source and target table, with the ability to specify cardinality, and the direction of query and security filters. Object definition All objects have a common set of properties, including name, type, description, a properties collection, and annotations. Relationship objects also have the following properties. isActive A Boolean that indicates whether the relationship is marked as Active or Inactive. An Active relationship is automatically used for filtering across tables. An Inactive relationship can be used explicitly by DAX calculations with the USERELATIONSHIP function. crossFilteringBehavior Indicates how relationships influence filtering of data. See Bi-directional cross filters for tabular models in SQL Server 2016 Analysis Services for more information. Valid values are as follows: OneDirection (1) - The rows selected in the "To" end of the relationship will automatically filter scans of the table in the "From" end of the relationship. BothDirections (2) - Filters on either end of the relationship will automatically filter the other table. Automatic (3) - The engine will analyze the relationships and choose one of the behaviors by using heuristics. joinOnDateBehavior When joining two date time columns, indicates whether to join on date and time parts or on date part only. DateAndTime (1) - When joining two date time columns, join on date and time parts. DatePartOnly (2) - When joining two date time columns, join on date part only. relyOnReferentialIntegrity Unused; reserved for future use. securityFilteringBehavior An enumeration that indicates how relationships influence filtering of data when evaluating row-level security expressions. Valid values are as follows: OneDirection (1) - The rows selected in the "To" end of the relationship will automatically filter scans of the table in the "From" end of the relationship. BothDirections (2) - Filters on either end of the relationship will automatically filter the other table. Usage Relationship objects are used in Alter command (TMSL), Create command (TMSL), CreateOrReplace command (TMSL), and Delete command (TMSL). When creating, replacing, or altering a relationship object, specify all read-write properties of the object definition. Omission of a read-write property is considered a deletion. Full Syntax Below is the schema representation of a relationship object. "relationships": { "type": "array", "items": { "anyOf": [ { "description": "SingleColumnRelationship object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "isActive": { "type": "boolean" }, "type": { "enum": [ "singleColumn" ] }, "crossFilteringBehavior": { "enum": [ "oneDirection", "bothDirections", "automatic" ] }, "joinOnDateBehavior": { "enum": [ "dateAndTime", "datePartOnly" ] }, "relyOnReferentialIntegrity": { "type": "boolean" }, "securityFilteringBehavior": { "enum": [ "oneDirection", "bothDirections" ] }, "fromCardinality": { "enum": [ "none", "one", "many" ] }, "toCardinality": { "enum": [ "none", "one", "many" ] }, "fromColumn": { "type": "string" }, "fromTable": { "type": "string" }, "toColumn": { "type": "string" }, }, "toTable": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false } ] } } See Also Tabular Model Scripting Language (TMSL) Reference Create Relationships Roles object (TMSL) 3/24/2017 • 3 min to read • Edit Online Defines a role on the model that specifies a collection of permissions. Role membership consists of Windows security principles. You can set filters on a role to restrict access to specific objects. Object definition All objects have a common set of properties, including name, type, description, a properties collection, and annotations. Role objects also have the following properties. modelPermission Establishes a scope of permissions on a database. Valid values are none, read, readRefresh, refresh, and administrator. See Roles and Permissions (Analysis Services) for information about database permissions. members Members consist of both a member name and ID, where member name is the alias or friendly name of a Windows security principle, and the ID is the security identifier. Both are specified in role definition.See SID components for details about identifiers. tablePermissions A table permission is a named object with permissions defined via a DAX expression. This property is optional, used to apply a security filter. Usage Role objects are used in Alter command (TMSL), Create command (TMSL), CreateOrReplace command (TMSL), and Delete command (TMSL). A Role object is a property of a Model, but can also be specified as a property of a Database object given the oneto-one mapping between Model and Database. When creating, replacing, or altering a role object, specify all read-write properties of the object definition. Omission of a read-write property is considered a deletion. Full Syntax Below is the schema representation of a role object of a model. "roles": { "type": "array", "items": { "description": "ModelRole object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "description": { "anyOf": [ { "type": "string" "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "modelPermission": { "enum": [ "none", "read", "readRefresh", "refresh", "administrator" ] }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } }, "members": { "type": "array", "items": { "anyOf": [ { "description": "WindowsModelRoleMember object of Tabular Object Model (TOM)", "type": "object", "properties": { "memberName": { "type": "string" }, "memberId": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false }, { "description": "ExternalModelRoleMember object of Tabular Object Model (TOM)", "type": "object", "properties": { "memberName": { "type": "string" }, "memberId": { "type": "string" }, "identityProvider": { "type": "string" }, "memberType": { "enum": [ "auto", "user", "group" ] }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false } ] ] } }, "tablePermissions": { "type": "array", "items": { "description": "TablePermission object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "filterExpression": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false } } }, "additionalProperties": false } } See Also Tabular Model Scripting Language (TMSL) Reference Roles and Permissions (Analysis Services) Tables object (TMSL) 3/24/2017 • 7 min to read • Edit Online Defines the tables contained in a model. Tables in a model are either bound to tables in an external database from which data is imported or queried, or a calculated table constructed from a DAX expression. Within a table, one or more Partition objects describe the source of the data. Between tables, a Relationship object specifies the cardinality, filter direction, and other properties of the relationship. Object Definition All objects have a common set of properties, including name, type, description, a properties collection, and annotations. Table objects also have the following properties. dataCategory Specifies the type of Table, usually left unspecified. Valid values include 0 - UNKNOWN, 1 - TIME, 2 - MEASURE, 3 OTHER, 5 - QUANTITATIVE, 6- ACCOUNTS, 7 - CUSTOMERS, 8- PRODUCTS, 9 - SCENARIO, 10- UTILITY, 11 CURRENCY, 12 - RATES, 13 - CHANNEL, 4 - PROMOTION, 15 - ORGANIZATION, 16 - BILL OF MATERIALS, 17 – GEOGRAPHY. isHidden A Boolean that indicates whether the table is treated as hidden by client visualization tools. True if the Table is treated as hidden; otherwise false. columns Represents a column in a Table. It is a child of a Table object. Each column has a number of properties defined on it that influence how client applications visualize the data in the column. measures Represents a value that is calculated based on an expression. It is a child of a Table object. hierarchies Represents a collection of levels that provide a logical hierarchical drilldown path for client applications. It is a child of a Table object. Usage Table objects are used in Alter command (TMSL), Create command (TMSL), CreateOrReplace command (TMSL), Delete command (TMSL), Refresh command (TMSL), and MergePartitions command (TMSL). When creating, replacing, or altering a table object, specify all read-write properties of the object definition. Omission of a read-write property is considered a deletion. Condensed Syntax Table object definitions are complex. This syntax collapses interior properties and objects to give you a high-level look at the main parts. "tables": { "type": "array", "items": { "description": "Table object of Tabular Object Model (TOM)", "type": "object", "properties": { "dataCategory": { }, "description": { }, "isHidden": { }, "partitions": { }, "annotations": { }, "columns": { }, "measures": { }, "hierarchies": { }, Full Syntax Below is the schema representation of a tables object of a model. To reduce the size of this definition, Partition objects are described elsewhere. See Partitions object (TMSL). "tables": { "type": "array", "items": { "description": "Table object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "dataCategory": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "isHidden": { "type": "boolean" }, "partitions": { }, "columns": { "type": "array", "items": { "anyOf": [ { "description": "DataColumn object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "dataType": { "enum": [ "automatic", "string", "string", "int64", "double", "dateTime", "decimal", "boolean", "binary", "unknown", "variant" ] }, "dataCategory": { "type": "string" }, "description": { "type": "string" }, "isHidden": { "type": "boolean" }, "isUnique": { "type": "boolean" }, "isKey": { "type": "boolean" }, "isNullable": { "type": "boolean" }, "alignment": { "enum": [ "default", "left", "right", "center" ] }, "tableDetailPosition": { "type": "integer" }, "isDefaultLabel": { "type": "boolean" }, "isDefaultImage": { "type": "boolean" }, "summarizeBy": { "enum": [ "default", "none", "sum", "min", "max", "count", "average", "distinctCount" ] }, "type": { "enum": [ "data", "calculated", "rowNumber", "calculatedTableColumn" ] }, "formatString": { "type": "string" }, "isAvailableInMdx": { "isAvailableInMdx": { "type": "boolean" }, "keepUniqueRows": { "type": "boolean" }, "displayOrdinal": { "type": "integer" }, "sourceProviderType": { "type": "string" }, "displayFolder": { "type": "string" }, "sourceColumn": { "type": "string" }, "sortByColumn": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false }, { "description": "CalculatedTableColumn object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "dataType": { "enum": [ "automatic", "string", "int64", "double", "dateTime", "decimal", "boolean", "binary", "unknown", "variant" ] ] }, "dataCategory": { "type": "string" }, "description": { "type": "string" }, "isHidden": { "type": "boolean" }, "isUnique": { "type": "boolean" }, "isKey": { "type": "boolean" }, "isNullable": { "type": "boolean" }, "alignment": { "enum": [ "default", "left", "right", "center" ] }, "tableDetailPosition": { "type": "integer" }, "isDefaultLabel": { "type": "boolean" }, "isDefaultImage": { "type": "boolean" }, "summarizeBy": { "enum": [ "default", "none", "sum", "min", "max", "count", "average", "distinctCount" ] }, "type": { "enum": [ "data", "calculated", "rowNumber", "calculatedTableColumn" ] }, "formatString": { "type": "string" }, "isAvailableInMdx": { "type": "boolean" }, "keepUniqueRows": { "type": "boolean" }, "displayOrdinal": { "type": "integer" }, "sourceProviderType": { "sourceProviderType": { "type": "string" }, "displayFolder": { "type": "string" }, "isNameInferred": { "type": "boolean" }, "isDataTypeInferred": { "type": "boolean" }, "sourceColumn": { "type": "string" }, "sortByColumn": { "type": "string" }, "columnOriginTable": { "type": "string" }, "columnOriginColumn": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false }, { "description": "CalculatedColumn object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "dataType": { "enum": [ "automatic", "string", "int64", "double", "dateTime", "decimal", "boolean", "binary", "unknown", "variant" ] }, "dataCategory": { "type": "string" }, "description": { "type": "string" }, "isHidden": { "type": "boolean" }, "isUnique": { "type": "boolean" }, "isKey": { "type": "boolean" }, "isNullable": { "type": "boolean" }, "alignment": { "enum": [ "default", "left", "right", "center" ] }, "tableDetailPosition": { "type": "integer" }, "isDefaultLabel": { "type": "boolean" }, "isDefaultImage": { "type": "boolean" }, "summarizeBy": { "enum": [ "default", "none", "sum", "min", "max", "count", "average", "distinctCount" ] }, "type": { "enum": [ "data", "calculated", "rowNumber", "calculatedTableColumn" ] }, "formatString": { "type": "string" }, "isAvailableInMdx": { "type": "boolean" }, "keepUniqueRows": { "type": "boolean" }, }, "displayOrdinal": { "type": "integer" }, "sourceProviderType": { "type": "string" }, "displayFolder": { "type": "string" }, "isDataTypeInferred": { "type": "boolean" }, "expression": { "type": "string" }, "sortByColumn": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false } ] } }, "measures": { "type": "array", "items": { "description": "Measure object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } } ] }, "expression": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "formatString": { "type": "string" }, "isHidden": { "type": "boolean" }, "isSimpleMeasure": { "type": "boolean" }, "displayFolder": { "type": "string" }, "kpi": { "description": "KPI object of Tabular Object Model (TOM)", "type": "object", "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "targetDescription": { "type": "string" }, "targetExpression": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "targetFormatString": { "type": "string" }, "statusGraphic": { "type": "string" }, "statusDescription": { "type": "string" "type": "string" }, "statusExpression": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "trendGraphic": { "type": "string" }, "trendDescription": { "type": "string" }, "trendExpression": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false } }, "hierarchies": { "type": "array", "items": { "description": "Hierarchy object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "isHidden": { "type": "boolean" }, "displayFolder": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" "type": "string" } } ] } }, "additionalProperties": false } }, "levels": { "type": "array", "items": { "description": "Level object of Tabular Object Model (TOM)", "type": "object", "properties": { "ordinal": { "type": "integer" }, "name": { "type": "string" }, "description": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "column": { "type": "string" }, "annotations": { "type": "array", "items": { "description": "Annotation object of Tabular Object Model (TOM)", "type": "object", "properties": { "name": { "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "additionalProperties": false } } }, "additionalProperties": false } } }, "additionalProperties": false } } }, "additionalProperties": false } } See Also Tabular Model Scripting Language (TMSL) Reference TMSL Reference - Tabular Objects 5/10/2017 • 1 min to read • Edit Online Applications that create, consume, or administer Tabular databases or that connect to a SQL Sever 2016 Analysis Services instance in tabular mode, can use the Tabular Model Scripting Language (TMSL) for commands and object representations in JSON format. This article documents the major objects of the TMSL schema used in scripts generated by SQL Server Management Studio, SQL Server Data Tools (SSDT), and AMO PowerShell. Object definitions are in JSON and used in TMSL commands like Create, Alter, and Delete. See Commands in Tabular Model Scripting Language (TMSL) for a list of commands. Main objects The following table is list of the most commonly used objects in TMSL script. Database object (TMSL) Defines a Tabular database at compatibility level 1200 or higher, based on a model of the same level. Model object (TMSL) Defines a Tabular model at compatibility level 1200 or higher. DataSources object (TMSL) Defines a connection to a data source used during import to load the model, or for pass through queries when the model is in DirectQuery mode. Tables object (TMSL) Specifies the tables of the model. Partitions object (TMSL) Defines storage of table rowsets, including calculated tables. Relationships object (TMSL) Defines the relationships between tables. Roles object (TMSL) Defines permissions, membership, and security filters that control access to data and operations. See Also Tabular Model Scripting Language (TMSL) Reference