locked
SSAS tabular database restore XMLA, using DatabaseId errors out RRS feed

  • Question

  • I have been trying to figure out the syntax to input DatabaseId field into the restore command. Without specifying DatabaseId it works but with it I get the below error. What am I doing wrong ?

    Thank you

    <Restore xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
           <DatabaseName>Diablo</DatabaseName>
           <DatabaseId>Diablo</DatabaseId>
           <File>C:\TEMP\Diablo_SMALL.abf</File>
           <AllowOverwrite>true</AllowOverwrite>
           <DbStorageLocation xmlns="http://schemas.microsoft.com/analysisservices/2008/engine/100/100">C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Data\</DbStorageLocation>
    </Restore>
    
    
    Executing the query ...
    The DatabaseId element at line 9, column 14 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) cannot appear under Envelope/Body/Execute/Command/Restore.
    Execution complete
    


    Gokhan Varol

    Tuesday, August 20, 2013 3:08 PM

Answers

  • Hi Gokhan & Darren,

    The following XMLA command works for me on my test environment(SQL Server 2012 (SP1) - 11.0.3000.0 (X64) ):

    <Restore xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    	<DatabaseName>AdventureWorks Tabular Model SQL 2012</DatabaseName>
    	<DatabaseID>AdventureWorks Tabular Model SQL 2012</DatabaseID>
    		<File>C:\AdventureWorks Tabular Model SQL 2012.abf</File>
    	<AllowOverwrite>true</AllowOverwrite>
    	<DbStorageLocation xmlns="http://schemas.microsoft.com/analysisservices/2008/engine/100/100">C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Data\</DbStorageLocation>
    </Restore>

    @Darren, you are right. If we remove <DatabaseID> tag from the XMLA code above, the restore operation will automatically set the ID property to the database name. However, SQL Server 2012 introduce the <DatabaseID> tag of XMLA resotre element. Please refer to the document below:
    http://technet.microsoft.com/en-au/library/ms187189(v=sql.110).aspx

    If you have any feedback on our support, please click here.

    Best Regards,


    Elvis Long
    TechNet Community Support

    • Edited by Elvis Long Wednesday, August 21, 2013 7:34 AM edit
    • Marked as answer by Elvis Long Thursday, August 29, 2013 12:57 AM
    Wednesday, August 21, 2013 7:30 AM
  • Thanks Elvis, in this case I think it is just a case sensitivity issue and should be DatabaseID not DatabaseId.

    http://darren.gosbell.com - please mark correct answers


    • Edited by Darren GosbellMVP Wednesday, August 21, 2013 8:29 AM typo
    • Marked as answer by Elvis Long Thursday, August 29, 2013 12:57 AM
    Wednesday, August 21, 2013 8:29 AM

All replies

  • DatabaseId is not a valid element in a restore command see http://msdn.microsoft.com/en-au/library/ms187189(v=sql.90).aspx. The restore operation will automatically set the ID property to the same value as the name.

    http://darren.gosbell.com - please mark correct answers

    • Proposed as answer by Elvis Long Wednesday, August 21, 2013 6:50 AM
    Tuesday, August 20, 2013 8:53 PM
  • Hi Gokhan & Darren,

    The following XMLA command works for me on my test environment(SQL Server 2012 (SP1) - 11.0.3000.0 (X64) ):

    <Restore xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    	<DatabaseName>AdventureWorks Tabular Model SQL 2012</DatabaseName>
    	<DatabaseID>AdventureWorks Tabular Model SQL 2012</DatabaseID>
    		<File>C:\AdventureWorks Tabular Model SQL 2012.abf</File>
    	<AllowOverwrite>true</AllowOverwrite>
    	<DbStorageLocation xmlns="http://schemas.microsoft.com/analysisservices/2008/engine/100/100">C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Data\</DbStorageLocation>
    </Restore>

    @Darren, you are right. If we remove <DatabaseID> tag from the XMLA code above, the restore operation will automatically set the ID property to the database name. However, SQL Server 2012 introduce the <DatabaseID> tag of XMLA resotre element. Please refer to the document below:
    http://technet.microsoft.com/en-au/library/ms187189(v=sql.110).aspx

    If you have any feedback on our support, please click here.

    Best Regards,


    Elvis Long
    TechNet Community Support

    • Edited by Elvis Long Wednesday, August 21, 2013 7:34 AM edit
    • Marked as answer by Elvis Long Thursday, August 29, 2013 12:57 AM
    Wednesday, August 21, 2013 7:30 AM
  • Thanks Elvis, in this case I think it is just a case sensitivity issue and should be DatabaseID not DatabaseId.

    http://darren.gosbell.com - please mark correct answers


    • Edited by Darren GosbellMVP Wednesday, August 21, 2013 8:29 AM typo
    • Marked as answer by Elvis Long Thursday, August 29, 2013 12:57 AM
    Wednesday, August 21, 2013 8:29 AM
  • That's wonderful! Thanks for pointing this out.

    Best Regards,


    Elvis Long
    TechNet Community Support

    • Edited by Elvis Long Wednesday, August 21, 2013 9:21 AM typo
    Wednesday, August 21, 2013 9:14 AM
  • I guess it's misspelled on technet?

    http://technet.microsoft.com/en-us/library/ms187189.aspx


    Gokhan Varol

    Wednesday, August 21, 2013 2:31 PM
  • Yes, judging from Elvis' post it looks like there is a typo in technet. I've just posted a review on that article saying it's not helpful because it's inaccurate and added a link back to this topic.

    http://darren.gosbell.com - please mark correct answers

    Wednesday, August 21, 2013 8:53 PM