How are VIEWS useful?

Now before we dive into the variety of reasons for using a view, let’s first briefly understand what a view is.

To put simply, a view is a stored single SELECT query. Generally speaking, we use views to encapsulate a query, or part of a query, for reusability. 

Here are some reasons we can consider using a view for:

Hiding particular data for end users
We can use a view to hide any sensitive or unnecessary data for the end user. This can be done by limiting the number of rows seen with a WHERE clause or by only returning specific columns from the tables. Basically we can allow the end user to see what they only need to see, nothing more. This is useful for security purposes.

Reformatting data
Sometimes the way we store data in our tables is not very meaningful for our customers or end users. Views can be used to change the way that data is presented to a more understandable value.

Reporting
Often the creation of reports involve complex expensive queries that are executed frequently. Encapsulating that complex query in a view can reduce the compile time for that query.

In next week’s post, we will be going through some examples of these reasons in action!

Leave a reply:

Your email address will not be published.

Site Footer

Sliding Sidebar

About Us

About Us

VitalFew is a Data Platform consultancy business. VitalFew provides many services ranging from architectural design of SQL Server High Availability solutions, Performance Tuning, Troubleshooting, Migrations, Data Integrations and Reporting. The aim of this blog is to act as a pool of knowledge for anyone eager to learn further on Microsoft’s Data Platform, SQL Server.