I am new to SQL 2008.
For the past 3 days, I have been battling with TRIGGERS.
In my database, I have 2 tables : one is called "Details" (which includes : detailsid,personid,surname, firstname).
The second table is "Mainaddress" (addressid, personid, street, city).
These 2 tables share only one common attribute : personid
Next, I created a VIEW for these 2 tables, as follows :
SELECT dbo.mainaddress.street, dbo.mainaddress.city
INNER JOIN dbo.Details ON dbo.mainaddress.personid = dbo.Details.personid
But, as we all know, it is not possible to manipulate more than one base table when using VIEWS.
To solve this problem, I decided to create TRIGGERS. I created 3 triggers : one each for INSERT, UPDATE and DELETE.
But, for some reason, I keep getting the error :
INVALID COLUMN NAME ("column name")
I have searched far and wide for a solution : forums, Google, etc, but without success.
For example : here is my INSERT trigger.
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
View Complete Post