IF EXISTS (SELECT * FROM dbo.SysObjects WHERE id = object_id(N'dbo.TRIGGER_ArrangementLinesLastUpdDateStamp') AND OBJECTPROPERTY(id, N'IsTrigger') = 1) DROP TRIGGER dbo.TRIGGER_ArrangementLinesLastUpdDateStamp 
GO
CREATE TRIGGER [dbo].[TRIGGER_ArrangementLinesLastUpdDateStamp] ON [dbo].[ArrangementLines] AFTER INSERT,UPDATE AS
BEGIN
  SET NOCOUNT ON
  DECLARE @Time char(5)
  DECLARE @TimeDT datetime

  SELECT @Time = inserted.time FROM inserted
  SET @TimeDT = CONVERT(datetime, @Time, 108)

  UPDATE ArrangementLines 
  SET LastUpdDateStamp = GETDATE()
  , TimeDT = @TimeDT
--      ,TimeDT = CONVERT(datetime, Time, 108)
  WHERE ArrangementLines.ArrangementLineNumber IN (SELECT ArrangementLineNumber FROM inserted)
END
