February 27, 2012 at 4:21 am
Hi,
Can we delete/insert/update data through view. This view are using multiple tables.
Regards,
Sachin.
February 27, 2012 at 4:44 am
As long as you update data from a single table, yes.
As far as deletes is concerned, I don't think you can force deletion from a specific table and I guess you will have to code a trigger (INSTEAD OF kind) for that.
-- Gianluca Sartori
February 27, 2012 at 4:58 am
thanks a lot...:-)
February 27, 2012 at 5:30 am
February 27, 2012 at 5:36 am
sumitagarwal781 (2/27/2012)
To delete data through a view example.
I'm not saying it can't be done, but some restrictions apply.
BOL says:
The view referenced by table_or_view_name must be updatable and reference exactly one base table in the FROM clause of the view. For more information about updatable views, see CREATE VIEW (Transact-SQL).
See my point? Multiple joined tables means you have to code a trigger.
-- Gianluca Sartori
February 27, 2012 at 5:48 am
i completely agree with Gianluca Sartori
we have to include a trigger for proper action on all tables.
Regards
Durai Nagarajan
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply