Sql-server – Deploying a cube where database name has been changed

deploymentsql serverssas

I have an issue where I have renamed the database for which my cube deploys to from, say, SalesAndStuff to Sale.

This has been no issue, I have changed the database name in Management Studios etc.

My issue is that when I try to deploy my cube now from Visual Studio I get the error that

The database with the name of 'SalesAndStuff' already exists in the 'abc'
server

Which I have read is because SSAS figures that the database I wish to deploy my cube to should be to the database with the same name as the database ID created when I created the cube originally.

This name is SalesAndStuff. I have configured my cube under Project -> Cube properties -> Deployment -> Deploy to database Sale but for some reason this isn't recognized.

Any ideas how I can avoid this issue? Am I required to change my deployment properties to the original database, and subsequently rename the database in management studio?

The cube is used by many people who uses it for Excel reports etc. so I don't want to alter any Connection strings towards the cube.

Best Answer

This is basically because the Sale cube still has SalesAndStuff as the ID, renaming your database only changed the name

It will probably be the easiest if you just click "view code" in visual studio and change the <id> node to match your new name.

If that doesn't work out or you think that's too risky you can follow this procedure on msdn.

Make sure you only edit the ID for the database though. If you edit ID's for other objects such as dimensions you will mess up a lot of objects.

Create a backup of your database and solution before you try this.