Reply to Re: AFTER INSERT trigger not firing in SQL 2005

Your name:

Reply:


Posted by ibrettferguson on 07/28/06 17:33

ibrettferguson@gmail.com wrote:
> Nothing fancy; just a trigger on a sharepoint table that supposed to
> write a record to another SQL table.
>
>
> set ANSI_NULLS ON
> set QUOTED_IDENTIFIER ON
> go
>
> ALTER TRIGGER [TV_UpdateFileSyncProgress]
> ON [dbo].[Docs]
> AFTER INSERT
> AS
> BEGIN
> SET NOCOUNT ON;
>
> BEGIN
> IF EXISTS (SELECT null FROM inserted WHERE DirName like
> 'csm/%/Shared Documents')
>
> BEGIN
> IF NOT EXISTS (SELECT null FROM inserted INNER JOIN
> TV_FileSyncProgress fp ON LOWER(RTRIM(fp.LeafName)) =
> LOWER(RTRIM(Replace(Replace(inserted.DirName,'csm/',''),'/Shared
> Documents','') + '\' + inserted.LeafName)))
>
> BEGIN
> INSERT INTO TV_FileSyncProgress (InternalOrigin, ExternalOrigin,
> ChangeType, SiteId, DirName, LeafName, FlagForDelete)
> SELECT
> 0,1,1,SiteId,'F:\common\Extranet\',Replace(Replace(DirName,'csm/',''),'/Shared
> Documents','') + '\' + LeafName,0 FROM inserted
>
> END
>
> END
>
> END
>
> END


Figured it out.

A bug in my win service was deleting the records as they were being
inserted in the destination table.

Neat.

(Today, I would like to own a lawn care business... yes, a lawn care
business. )

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация