How to update views in SQL Server

You can modify data through a view by using INSTEAD OF trigger. INSTEAD OF INSERT triggers defined on a view (or table) replace the standard action of the INSERT statement with your statements.
For exemplifications I’ve create 2 tables and a view as follows:

CREATE TABLE Person (
SSN int PRIMARY KEY,
name varchar(100)
)

CREATE TABLE Patient(
SSN int PRIMARY KEY,
blood_group varchar(5),
CONSTRAINT FKPerson FOREIGN KEY (SSN)
REFERENCES Person (SSN)
)
GO

CREATE VIEW PersonPatient as
SELECT Person.SSN, Person.name, Patient.blood_group
FROM Person
INNER JOIN Patient ON Person.SSN = Patient.SSN
GO

Below is instead of trigger executed when a new row is trying to be added to PersonPatient view. Its business is very simple: inserts a row in Person table and a row in Patient table. Of course, your business might be more complicated. For example, you can add business to manage duplicate patients, etc

CREATE TRIGGER IOS_PersonPatient ON PersonPatient
INSTEAD OF INSERT
AS
BEGIN
INSERT INTO Person(SSN, name)
SELECT SSN, name from inserted
INSERT INTO Patient(SSN, blood_group)
SELECT SSN, blood_group FROM inserted
END

Having instead of trigger, now you can write insert statements instead PersonPatient view:

INSERT INTO PersonPatient(SSN, name, blood_group)
VALUES (1234567890, 'John Smith', 'B')

Another way to data through a view is using updatable partitioned views.

Is this useful?