Answered by:
Just wondering about the Namespace declarations in XMLA

Question
-
The SQL Mangement Studio SQL Server 2012 scripts a XMLA object processing script this way:
<Batch Transaction="false" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Process xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100"
xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"
xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300"
xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
<Object>
<DatabaseID>OlapDatabaseId</DatabaseID>
<DimensionID>Dimension 1 ID</DimensionID>
</Object>But does the process element really needs all this namespace declaration? The script executes also if i remove all namespaces in the process element.
Do i really need them?
Best Regards
Paolo- Edited by Paolo Taverna Friday, August 16, 2013 11:36 AM
Friday, August 16, 2013 11:36 AM
Answers
-
I think you only need the namespaces which are referenced in the script.
In the example you posted it is only using the default namespace so I think only the xmlns="..." from the batch command is required.
If the other namespaces were used you would see elements with prefixes like <ddl300:MyElement>...
Because none of the elements in the process command contain any namespace prefixes I believe that it will not hurt to exclude the namespace references.
http://darren.gosbell.com - please mark correct answers
- Marked as answer by Elvis Long Monday, August 26, 2013 4:40 AM
Saturday, August 17, 2013 12:18 PM
All replies
-
I think you only need the namespaces which are referenced in the script.
In the example you posted it is only using the default namespace so I think only the xmlns="..." from the batch command is required.
If the other namespaces were used you would see elements with prefixes like <ddl300:MyElement>...
Because none of the elements in the process command contain any namespace prefixes I believe that it will not hurt to exclude the namespace references.
http://darren.gosbell.com - please mark correct answers
- Marked as answer by Elvis Long Monday, August 26, 2013 4:40 AM
Saturday, August 17, 2013 12:18 PM -
Hi Darren
Im sorry for the late answer. Was busy with other Projects. Im going to test the a script Definition with the following namespace declarationa in the XMLA <Batch> element:
xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"The other elements will remain without any Namespace declaration. Hope that i can test it this week, will inform you if it worked.
Regards Paolo
Wednesday, August 28, 2013 7:25 AM -
Did you test it Paolo?
I can confirm that SSAS processing seems to be working fine (as Darren suggested it would) when only keeping the one single xmlns reference in the opening <Batch> tag, and removing all others, so it stands like this:
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
The question is, are there any possible downsides or unexpected behavior when removing the XML namespaces? It seems like because they are there and inserted when you script out a processing command to XMLA, they should also have a purpose, or?
The advantage of removing the namespaces is obvious: we save a lot of characters in the XMLA-script when removing the name space references, especially when we have many objects to process, and this is important when building the XMLA dynamically and storing it in a variable.
Friday, September 28, 2018 2:00 PM