XML/A = "XML for Analysis Services" is so called, because it is XML and not JSON, See
Execute TMSL in SSMS
I have a tmsl code which looks something like this:
{
"createOrReplace": {
"object": {
"database": "TabularProject1"
},
"database": {
"name": "TabularProject1",
"compatibilityLevel": 1600,
"model": {
"culture": "en-US",
"dataSources": [
{
"type": "structured",
"name": "SQL/my_server_name;empDB",
"connectionDetails": {
"protocol": "tds",
"address": {
"server": "my_server_name",
"database": "empDB"
},
"authentication": null,
"query": null
},
"credential": {
"AuthenticationKind": "UsernamePassword",
"kind": "SQL",
"path": "my_server_name;empDB",
"Username": "sa",
"EncryptConnection": false
}
}
],
"tables": [
{
"name": "employees",
"columns": [
{
"name": "emp_id",
"dataType": "int64",
"sourceColumn": "emp_id"
},
{
"name": "emp_name",
"dataType": "string",
"sourceColumn": "emp_name"
}
],
"partitions": [
{
"name": "Partition",
"dataView": "full",
"source": {
"type": "m",
"expression": [
"let",
" Source = #\"SQL/my_server_name;empDB\",",
" dbo_employees = Source{[Schema=\"dbo\",Item=\"employees\"]}[Data]",
"in",
" dbo_employees"
]
}
}
]
}
],
"annotations": [
{
"name": "ClientCompatibilityLevel",
"value": "700"
}
]
}
}
}
}
I want to exeucte it in ssms. I right click on Analysis Service Engine in SSMS, then New Query then XMLA. But when I paste this json format code there I get this error on the very first curly bracket with a red squiggly line:
Invalid token 'Text' at root level of document.
And following error with a red squiggly line at the very last curly bracket:
XML must contain a root level document.
Also when I execute this script I get following error:
Executing the query ...
The following system error occurred: A device attached to the system is not functioning.
Session cancelled per end session header in user request.
Session cancelled per end session header in user request.
Run complete
Please note that my sql server is 2022 and compatibility level 1600. My_server_name is actually another server where sql server database is installed and that database is the datasource to my tabular model. Also in that same server is analysis serivce is installed where I want to build TabularProject1 database.
Any help in this regard is highly appreciated. Anyother method of creating database will not work.