SSAS: Error Deploying Metadata

This error threw me for a loop the first time I saw it and I figured I should post about it in case someone else has the same problem.

In Visual Studio I was making some changes to an SSAS tabular model I'd previously deployed. When I went to deploy it again with my updates I was presented with an error message for the work item "Deploy metadata", status "Error deploying metadata". Clicking on Error details gives a very unhelpful message: "Failed to save modifications to the server. Error returned: 'The column 'TableName[FieldName]' cannot be of type Empty. The Empty data type can only be set on a column if the column is either a calculated column or is part of a calculated table.'.".

As with many error messages, this is totally unhelpful and doesn't actually help in figuring out the problem. No field in my model was set to a data type of 'Empty' - and certainly not the one referenced in the error message!

What works for me when this happens is to go to the SSAS server directly in SQL Server Management Studio and to delete the model. Then when I try deploying from Visual Studio again it succeeds.

Why does this happen? I have no idea. If you have some insight I would love to hear about it in the comments. I have come to expect this behaviour any time I have deleted an object from my model and then created a new one with the same name. Redeployments seem to always fail after I've done that.

11 comments:

  1. I've experienced the same thing. I tend to rename the problematic columns (add a 1 to the end) then deploy. After the deployment revert the columns to the original name and redeploy. Strange - but works

    ReplyDelete
    Replies
    1. I like that! Thanks for this tip.

      Delete
    2. Yes, even though weird, this idea worked! Thanks a lot! :)

      Delete
    3. Mikel's solution worked for me. Thanks

      Delete
  2. thank you for the idea!

    ReplyDelete
  3. Yes, even though it's weird, this worked! thanks a lot :)

    ReplyDelete
  4. Thanks for your tip. It worked for me as well :)

    ReplyDelete
  5. lost my issue too, thanks!

    ReplyDelete
  6. as of 2022 it works!

    ReplyDelete
  7. face issue with me also, i have rename it and successfully deployed, and again changed to original column and deployed again it is successfully deployed...
    hahaha

    ReplyDelete