Msg 4405, Level 16, State 1, Line 1
View or function ‘%.*ls’ is not updatable because the modification affects multiple base tables.
This error message appears when you try to update data in a view that affects more than one base table.
The T-SQL statement can be parsed, but causes the error at runtime.
Errors of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. You cannot use a view to update data in more than one base table at a time. Consider using a stored procedure instead.
All versions of SQL Server.
IF OBJECT_ID(‘dbo.MyOrders’, ‘View’) > 0
DROP VIEW dbo.MyOrders
CREATE VIEW dbo.MyOrders
SELECT od.Discount, o.ShippedDate
FROM dbo.Orders o
JOIN [Order Details] od
ON o.OrderID = od.OrderID
SET ShippedDate = NULL, Discount = NULL
WHERE ShippedDate IS NULL
In the above example we try to update the view dbo.MyOrders. Because the SELECT list of the view contains columns from more than one base table, the error is raised.