Database Reference
In-Depth Information
Views are a very useful means of changing names when needed. In turn,
with views we are publicly declaring the name change so that everybody
will easily understand that a specific field with a name in one level is—in
reality—a field that has another name in the previous level.
Clearly, we should avoid the practice of changing names at each level. As
always, having the opportunity to do something does not mean that we need
to do it.
We can perform simple calculations in views easily : If we need to multiply
the value of two columns, for example, Qty * Price , to use in a measure in
our cube we have two options. We can perform the calculation in the DSV,
but as earlier, we are hiding the calculation in a Visual Studio project and
other people will not be able to see what we're doing easily. If we perform
the calculation in a view, then other developers can reuse it, and tracking
dependencies is more straightforward.
This is certainly true for simple calculations. On the other hand, if we're
performing complex calculations in views then we are probably missing
some transformation code in our ETL. Moreover, performing this calculation
will waste time when we execute the view. Performing the calculation during
ETL will mean we compute the value only once; from then it will always
be available.
Views are made up of plain text : We can easily search for all the occurrences
of a specific column, table, or any kind of value using a simple text editor.
We do not need any specialized development tools or to dive into unreadable
XML code to have a clear view of how a specific field is used.
If we need to update a view, we can do it without opening SQL Server Data
Tools. This means that nearly everybody can do it, although, as it is very easy
to update a view, some sort of security does need to be applied.
Furthermore, as views are simple text, a source control system can handle
them very easily. We can check who updated what, when they did it, and
what they changed very easily.
Views can be updated very quickly : A view can be updated very quickly as
it does not require any kind of processing; we just ALTER it and the work is
done. We do not need to use an UPDATE statement if we want to make simple
(and possibly temporary) changes to the data.
Views can reduce the number of columns we expose : There is really no
need to expose more columns to a cube than it needs. Showing more columns
will only lead to confusion and a chance that the wrong column will be used
for something.
 
Search WWH ::




Custom Search