View Single Post
 
Old November 18th, 2004, 06:14 PM
Arsi Arsi is offline
Authorized User
Points: 457, Level: 7
Points: 457, Level: 7 Points: 457, Level: 7 Points: 457, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: Burbank, CA, USA.
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default

Ok. I think I messed things up. I'm trying to do what you told me with the insert, but I have made a mess of it. Can you please help me with this too?
ALTER TRIGGER [Update_DB] ON [dbo].[ProjectInfo]
FOR INSERT, UPDATE
AS
If UPDATE(ProjectName)
IF EXISTS (SELECT ProjectStatus..ProjectName
        FROM ProjectStatus
        WHERE ProjectStatus..ProjectName = ProjectInfo.ProjectName)
    UPDATE ProjectStatus..ProjectInfo2
    SET ProjectName = i.ProjectName
    FROM DELETED d, ProjectStatus..ProjectInfo2 t, INSERTED i
    WHERE d.ProjectName = t.ProjectName
ELSE
INSERT ProjectStatus..ProjectInfo2 (ProjectName)
VALUES (ProjectInfo..ProjectName)
RETURN

I would really appreciate it. Thank you.

*******(*)*******