Why do I get this error?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top