Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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 ajoutée par Shakir Ali , Full Stack Developer , https://www.freelancer.com
Date de publication: 2017/05/23
AbdelMalek AIT AMOKHTAR
par 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
par 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
par 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
par 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