Create views for all your tables in one step
I have to admit that I am a little lazy. So if there is something I have to do more than once I’ll try and find a quicker way.
One of these tasks in any DW build is creating views for all your dimension and fact tables to create an abstraction layer between the relational tables and the client tool or SSAS Data Source Views. These views can be useful for all sorts of functionality such simplifying currency conversion or creating calculated fields.
What really becomes a nuisance is when using a RAD approach you can find yourself re-creating these views several times over.
The below script automates this process. For it to work properly you must set SSMS to “Results to Text”:
This could be wrapped in a stored proc if you were super keen.
Running this against AdventureworksDW will result in an output something like: