当前日期存储
CREATE PROCEDURE [dbo].[up_TransportationDetailEdit]
@TransGuid uniqueidentifier,
@RequestGuid uniqueidentifier,
@TransFrom varchar(50),
@TransTo varchar(50),
@TransDate datetime,
@TransNo varchar(50),
@DepTime varchar(10),
@ArrTime varchar(10),
@CreatedAt datetime
AS
IF(EXISTS(SELECT 1 FROM T_TransportationDetail trm WHERE trm.TransGuid=@TransGuid))
BEGIN UPDATE T_TransportationDetail SET RequestGuid=@RequestGuid, TransFrom=@TransFrom, TransTo=@TransTo, TransDate=@TransDate, TransNo=@TransNo, DepTime=@DepTime, ArrTime=@ArrTime, CreatedAt=@CreatedAt
WHERE TransGuid=@TransGuid END
ELSE
BEGIN INSERT INTO T_TransportationDetail ( TransGuid, RequestGuid, TransFrom, TransTo, TransDate, TransNo, DepTime, ArrTime, CreatedAt ) VALUES ( @TransGuid, @RequestGuid, @TransFrom, @TransTo, @TransDate, @TransNo, @DepTime, @ArrTime, GETDATE() ) END