|
Posted by Yas on 08/16/07 23:05
On 16 Aug, 22:58, Erland Sommarskog <esq...@sommarskog.se> wrote:
> Yas (yas...@gmail.com) writes:
> > CREATE TRIGGER my_Trigger ON [dbo].[Table2]
> > FOR INSERT
> > AS
>
> > INSERT INTO
> > Table2(STATUS,attribute15,email,lastname1,lastname2,name,company,startDate)
> > SELECT 'Active' AS STATUS, b.Attribute15, b.email, b.lastname1,
> > b.lastname2, b.name,
> > b.company, b.startDate
> > FROM Inserted b LEFT OUTER JOIN
> > Table2 a ON b.Attribute15 = a.Attribute15
> > WHERE a.Attribute15 IS NULL
> > GO
>
> > The syntax according to MS SQL server is correct but nothing happens
> > when a new row is inserted into Table1.
>
> Well, the code you posted is a trigger on Table2, so...
>
DOH!!! what a silly mistake. :-) do you think apart from that its fine
for inserting new rows into Table2 from Table1 trigger?
Thanks agian
Navigation:
[Reply to this message]
|