S
shapper
Hello,
I am inserting a record in a SQL table using a ListView and a
LinqDataSource.
My table as a trigger:
CREATE Trigger FilePath ON Files
AFTER INSERT, UPDATE
AS
IF EXISTS (SELECT * FROM INSERTED)
-- Replace filename by FileID
BEGIN
UPDATE f
SET f.Path=REPLACE(i.Path, '$Guid$', CAST(i.FileID AS varchar(50)))
FROM Files f
INNER JOIN INSERTED i
ON i.FileID=f.FileID
WHERE PATINDEX('%$Guid$%',i.Path)>0
END
GO
When I insert the record I get the following error:
The target table 'dbo.Files' of the DML statement cannot have any
enabled triggers if the statement contains an OUTPUT clause without
INTO clause.
Why am I getting this error?
And how can I find what query is the LinqDataSource generating?
The table has only 3 columns: FileID, Description and Path
Thanks,
Miguel
I am inserting a record in a SQL table using a ListView and a
LinqDataSource.
My table as a trigger:
CREATE Trigger FilePath ON Files
AFTER INSERT, UPDATE
AS
IF EXISTS (SELECT * FROM INSERTED)
-- Replace filename by FileID
BEGIN
UPDATE f
SET f.Path=REPLACE(i.Path, '$Guid$', CAST(i.FileID AS varchar(50)))
FROM Files f
INNER JOIN INSERTED i
ON i.FileID=f.FileID
WHERE PATINDEX('%$Guid$%',i.Path)>0
END
GO
When I insert the record I get the following error:
The target table 'dbo.Files' of the DML statement cannot have any
enabled triggers if the statement contains an OUTPUT clause without
INTO clause.
Why am I getting this error?
And how can I find what query is the LinqDataSource generating?
The table has only 3 columns: FileID, Description and Path
Thanks,
Miguel