安装 sql server 功能包 中的 SQL Server AMO 组件
在C:Program FilesMicrosoft SQL Server120SDKAssemblies 目录中 引用 Microsoft.AnalysisServices.DLL
using Microsoft.AnalysisServices;
private void button1_Click(object sender, EventArgs e)
{
Server srv = new Server();
srv.Connect("Data source=.");
Database db = srv.Databases["DSTEST"];
Cube cube = db.Cubes["商品管家"];
CubeDimension cubedim = cube.Dimensions["款"];
Dimension dim = cubedim.Dimension;
DimensionAttribute attr = dim.Attributes["款大类"];
attr.Name = "款大类_update";
dim.Update();
}