Issues with a SQL trigger, it takes 10 seconds to run and I cannot see why...please can you help:
Code:
USE [Sound]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[trSound_Changepath]
ON [dbo].[SoundFiles]
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
UPDATE s
SET s.[SoundFile] = 'D:\Recordings' + substring(i.[SoundFile] , 40 , len(i.[SoundFile] ) - 26)
FROM dbo.[SoundFiles] s
JOIN inserted i
ON s.[SoundFile] = i.[SoundFile]
WHERE Left(i.[SoundFile],2) = 'C:'
AND i.[SoundFile] <> 'c:\M2.encrypt'
END
Comment