Unanswered: Different View Statements on different actions
I have the following problem: I have a view that returns value from 2 tables: the first table (aaa) is stored on the local instance and database where the view is also located, the second table (Table1) is a tabel from a linked server (linked with sp_addlinkedserver). The view has the following statement:
SELECT r.AspId, r.ObjId, m.xxx1, m.a2, m.a4
FROM dbo.aaa r LEFT OUTER JOIN
MSDETest.LinkTest.dbo.Table1 m ON r.xxx1 = m.xxx1
WHERE (r.EB_VrsId = 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF').
This is correct and works al long as I do not perform an INSERT (but UPDATE works). When an INSERT is performed, the view statement should actually look like this:
SELECT AspId, ObjId, xxx1, a2, a4
WHERE (EB_VrsId = 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF')
Could anybody tell me how to do this? Maybe with triggers? I prefer some examples, because I am a relative newbie on this topic.
PLEASE!!!! help me. I would be very thankful!