Aaron Drenberg
Aaron Drenberg

Reputation: 1117

Process Analysis Services Database With C# Is Freezing

I'm using the Microsoft.AnalysisServices.Server class to connect to an instance of SSAS.

I retrieve the database by name and call the Process method with ProcessType.ProcessFull as the option.

server.Databases.FindByName("MyDatabase").Process(ProcessType.ProcessFull)

The program hangs for an hour, and afterwards the database will not be processed.

I also tried passing an XMLA command to process the database using the Server class. This command works when run in Sql Server Management Studio, but does not run when I pass it in through the server connection.

server.Execute("My XMLA Process Command")

I use server.Execute to pass the XMLA command to create the database before I try to process it. The create database command works fine, but the process database command will not work using either XMLA or the C# objects. It just freezes the program for an hour and the database is not processed.

Any help would be greatly appreciated. Thanks in advance.

Upvotes: 0

Views: 1533

Answers (2)

TilleyTech
TilleyTech

Reputation: 441

I found this thread today, march 24 2023, and the code above no longer works, although does not error...

I managed to get it working by taking the XML (taken from the SQL Mgmt Studio 'script' button right-click 'Process' and then using this XML like so:

using Microsoft.AnalysisServices;
using Microsoft.AnalysisServices.Core;

//in a function/method    
Microsoft.AnalysisServices.Server server = new Microsoft.AnalysisServices.Server();
        
server.Connect(<your connection string>);
        
server.Execute(<the XML string taken from the server mgmt studio process script >);

Upvotes: 0

bryanmac
bryanmac

Reputation: 39306

Full processing can take quite awhile depending on the size of your data.

If you're creating a gui app and it's not responding, it could be because you're doing an extremely long running task on the main thread. Try something like a BackgroundWorker or ThreadPool.QueueUserWorkitem to run it in the background.

To see what's going on, you can get progress by subscribing to the progress events and updating your UI in the main thread.

Here's a thread that describes subscribing to those progress trace events:

http://social.msdn.microsoft.com/forums/en-US/sqlanalysisservices/thread/e9f87b28-a8c2-40fc-b6e6-68dfa59b07a6

Upvotes: 0

Related Questions