Exceter
August 11th, 2003, 12:07 AM
How to set the variable value from the "inserted"?
Here I want to insert value inserted into one table, insert another tables too.
but I have error in red line,
May be there are other ways to do that?
CREATE TRIGGER GeneralInsert
ON PersonalFile
FOR INSERT
AS
BEGIN
DECLARE @PF varchar(10)
SELECT PersonalFile
FROM inserted i
SET @PF = i.PersonalFile
Insert into Table1(PersonalFile)
VALUES(@PF)
Insert into Table2(PersonalFile)
VALUES(@PF)
Insert into Table3(PersonalFile)
VALUES(@PF)
END
Here I want to insert value inserted into one table, insert another tables too.
but I have error in red line,
May be there are other ways to do that?
CREATE TRIGGER GeneralInsert
ON PersonalFile
FOR INSERT
AS
BEGIN
DECLARE @PF varchar(10)
SELECT PersonalFile
FROM inserted i
SET @PF = i.PersonalFile
Insert into Table1(PersonalFile)
VALUES(@PF)
Insert into Table2(PersonalFile)
VALUES(@PF)
Insert into Table3(PersonalFile)
VALUES(@PF)
END