Is there any way to prevent SQL Server Data Tools and Visual Studio from introducing spaces into object names when creating dimensions, mining structures and the like from data source views (DSVs)?

For example, if you happen to have columns named WordCount and IsList defined in your DSV, the SSDT/Visual Studio GUIs will automatically change the names to "Word Count" and "Is List." Although this may be more "end-user-friendly," it can cause a lot of problems if your goal is to tightly synchronize object names with the relational objects the DSV columns are derived from; for example, scripts that try to make some kind of statistical comparison between the relational column and data calculated upon it in a cube may fail because the object names are different. It can also cause difficulties in synchronizing report writing and documentation generation. It's cumbersome to have to manually remove the spaces that SSDT/Visual Studio introduce (as well as risky, given that these tools are notoriously temperamental when it comes to juggling metadata, leading to all kinds of obscure SSAS errors) so I'd like to shut off this "feature" permanently if possible. Thanks in advance.

Note that I did not indicate an edition of SSDT or Visual Studio because I have yet to see one that doesn't exhibit this behavior.


I don't think it's possible to turn the "feature" off, but the way it works is that it interprets caps and underscores as a new word so a field in your datasource MyAttribute or my_attribute becomes a member named My Attribute.

The only way I can think of to prevent this is to have your column names all lower case without underscores in your datasource so myattribute as a column name will stay myattribute as your member name.

I'm not sure how your comparison scripts work and how you generate them, but I think you'll have to resort to either removing the space when you generate an SQL query or parsing and adding a space according to the same logic when generating your MDX. In powershell that should be fairly easy.

| improve this answer | |
  • Thanks for the feedback, I'll probably wait a long time before choosing an accepted answer just in case someone knows of an arcane way of shutting it off. I use camel case 100% of the time in Visual Studio, SQL Server and SSAS and changing the naming system this late in the game would cause far more trouble than it's worth...Simply manually removing the spaces in the SSDT has so far been less problematic than writing scripts that remove the spaces, but it's still tedious. Perhaps an XMLA script that automatically removes the spaces would be the best solution LOL. – SQLServerSteve May 25 '18 at 8:33
  • 1
    @SQLServerSteve No problem, I realize my answer doesn't fulfill your needs and you can surely leave this question open – Tom V May 25 '18 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.