Monday, March 19, 2012

Deleting a database

I would like to delete a database from Analysis Services from the command line, but I have been unable to find a way to accomplish this. Is there a utility or a script that can accomplish this?

Hi

In MSAS 2k ,You can a write a VBSCRIPT using DSO object in DTS for deletion of OLAPDB.Then run this DTS from DTSRUN "DTS Package name" from commnad line.

Thx and regards

Pankaj

|||

And if you are using Analysis Services 2005, you can write this C# application based on AMO (the management object model for AS2005, successor of DSO from AS2000):

(to reference AMO, use Microsoft.AnalysisServices.DLL from "%ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies")

using Microsoft.AnalysisServices;

...

Server s = new Server();

s.Connect("localhost");

try

{

s.Databases.GetByName("My Database").Drop();

}

finally

{

s.Disconnect();

}

No comments:

Post a Comment