I am using SQL Server 2012:
The query is:
create table t11 (pid int not null, emp varchar(10))
create table t12 (id bigint, fn varchar(100))
create view tesr
as
select
a.pid, b.fn
from
t11 a
join
t12 b on a.pid = b.id
create trigger tesr_trig on dbo.tesr
instead of insert
as
begin
insert into t11
select i.pid, i.emp
from inserted i
insert into t12
select i.id, i.fn
from inserted i
end
I get the following error while executing:
Msg 207, Level 16, State 1, Procedure tesr_trig, Line 5
Invalid column name 'emp'.
Msg 207, Level 16, State 1, Procedure tesr_trig, Line 6
Invalid column name 'id'.
What is mistake I am making?
idorempin the projection of your view