Reputation: 31
Software Used:SQL Server 2016 ,Visual Studio 2015.
Description:
Code Begins:
server.Restore(backupFolderPath + "\\" + model.Value.Trim(), model.Key.Trim(), true)
server.Refresh(true, RefreshType.LoadedObjectsOnly);
Database database = server.Databases.GetByName(model.Key.Trim());
database.DataSources[0].ConnectionString = connectionString;
database.DataSources[0].Update();
database.Update();
database.Process(ProcessType.ProcessFull);
Code Ends
Process database is throwing the below error after restoring from .abf file.
"This command cannot be executed on database 'Test Session Model' because it has been defined with StorageEngineUsed set to TabularMetadata.For databases in this mode, you must use Tabular APIs to administer the database.\r\n"
Our model is in-memory based model. But the ‘StorageEngineUsed’ was set to ‘TabularMetadata’. We have tried to set the ‘StorageEngineUsed’ to ‘InMemory’ using below code.
database.StorageEngineUsed = StorageEngineUsed.InMemory;
database.Update();
still it is failing at process database with below error. "Database 'BI CAD Session Model Copy' has compatibility level larger than 1103 with StorageEngineUsed set to InMemory. Tabular databases with compatibility level at 1200 or above must use StorageEngineUsed set to TabularMetadata.\r\n"
But setting the compatability to less than 1200 (1103) is throwing error.
Please help us to resolve the process database issue.
Upvotes: 2
Views: 1766
Reputation: 31
I got answer. If we want to manipulate a Tabular model in 1200 compatibility mode we need to use the new Microsoft.AnalysisServices.Tabular.dll instead of Microsoft.AnalysisServices.dll .
refer https://msdn.microsoft.com/en-us/library/mt706505.aspx?f=255&MSPPError=-2147217396
Upvotes: 0