Is using "view" in db design right method or we should handle it code side? What are the advantages or disadvantages?
Design Flexibility: By using a view instead of a query in an application, it is easier to make changes to the underlying table structure. Improved Security: By using a view to return data from tables instead of a SELECT, you can hide the WHERE clause or other columns to which you do not want the user to have access.
Restricting data access – Views provide an additional level of table security by restricting access to a predetermined set of rows and columns of a table. Hiding data complexity – A view can hide the complexity that exists in a multiple table join.
A VIEW in SQL Server is like a virtual table that contains data from one or multiple tables. It does not hold any data and does not exist physically in the database. Similar to a SQL table, the view name should be unique in a database. It contains a set of predefined SQL queries to fetch data from the database.
I see a couple of reasons to use views :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With