Azure Analysis Services - Unable to delete an existing database using SSMS

D U Maheswara Rao 1 Reputation point
2022-10-29T15:06:10.857+00:00

Hi All,
I have a database in analysis server which I want to delete completely. I guess that the database is corrupted somehow as I'm not able to connect that model to powerbi or do any operation on that model (simple operations too..for instance generating an xmla script in SSMS).
I looked up the Microsoft Learn and found the xmla query to delete the model which is as below.

When I run the above xmla query, it throws me this error

Executing the query ...  
The Delete element at line 7, column 112 (namespace https://schemas.microsoft.com/analysisservices/2003/engine) cannot appear under Envelope/Body/Execute/Command.  
  
Technical Details:  
RootActivityId: dfc09b8e-8675-4b6r-92cc-ahgd94b119ac  
Date (UTC): 10/29/2022 2:52:02 PM  
  0: PFError::SetLastError()+0x338  
  1: PFSetLastError()+0x477  
  2: PCSAXHandler::PrepareParseDDLNamespace()+0xd7  
  3: 
Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
456 questions
{count} votes

3 answers

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,451 Reputation points Microsoft Employee
    2022-11-03T09:49:31.497+00:00

    Hi @D U Maheswara Rao ,

    <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">  
           <Delete xmlns="https://schemas.microsoft.com/analysisservices/2003/engine" IgnoreFailures="true">  
                  <Object>  
                         <DatabaseID>DBName</DatabaseID>            
                  </Object>  
           </Delete>  
    </Batch>  
    

    Maybe this should work better. Kindly check and let me know how it goes.

    -----------

    Please consider hitting Accept Answer button. Accepted answers help community as well.


  2. Sanjaykumar Gajwani 0 Reputation points
    2023-02-03T12:02:59.68+00:00

    here is something I tried, its executing the command but running forever and I don't know whether the database will be able to delete

    <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    	<Delete >
    		<Object>
    			<DatabaseID>DBID</DatabaseID>
    		</Object>
    	</Delete>
    </Batch>
    
    0 comments No comments

  3. Sanjaykumar Gajwani 0 Reputation points
    2023-02-03T13:43:36.4066667+00:00

    after I restart the server and next immediately I tried to delete the corrupted database, it got deleted successfully.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.