Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to make views updateable in sql server?

How to make views updateable in sql server while retrieving data from two tables. 

user-image
Question added by Shakir Ali , Full Stack Developer , https://www.freelancer.com
Date Posted: 2017/05/23
AbdelMalek AIT AMOKHTAR
by AbdelMalek AIT AMOKHTAR , SharePoint Freelancer , DotNet Partners

The views in SQL Server are updateable by design. howerver there is some restrictions on th update operation it serlf:

- the columns modified must be from the same table- the column modified must be real columns (not the result of an aggregation or calculation).

If you have to do modification that don't respect the restrictions, you can create an "Instead Of" trigger to tel how the modification could be done

Mahesh vootnuri
by Mahesh vootnuri , DBA , smartdrive systems india pvt ltd

we requires UPDATE, INSERT, or DELETE permissions on the target table, depending on the action being performed.

By Using Sql management studio  

in object explorer we can find views than expand views 

then right click the view and select top 200 rows

Mohammed Nurul Amin Mozumder
by Mohammed Nurul Amin Mozumder , Deputy coordinator , Integrated Development Foundation

The SQL UPDATE VIEW command can be used to modify the data of a view. All views are not updatable. So, UPDATE command is not applicable to all views. An updatable view is one which allows performing a UPDATE command on itself without affecting any other table.

Husain Jahid
by Husain Jahid , Developer , Symphony Softtech Ltd

CREATE VIEW Name AS SELECT colum_Name1,colum_Name2,colum_Name3,colum_NameN FROM table_Name WHERE colum_Name IN ('value_1','value_2');

More Questions Like This