CREATE PROCEDURE [dbo].[StopLogDateTime] @id as int AS BEGIN UPDATE logdatetime SET [stop]= getdate() WHERE id=@id AND [stop] is null END