UPDATE [dbo].[Order]
SET CreateDate = STUFF(CONVERT(VARCHAR(50),CreateDate,126) ,1, 10, '2016-05-26')
WHERE CONVERT(DATE,CreateDate)='2016-05-24'
运行这条语句就会把CreateDate字段中日期更改而时间不变
2023-12-19 22:52:22
UPDATE [dbo].[Order]
SET CreateDate = STUFF(CONVERT(VARCHAR(50),CreateDate,126) ,1, 10, '2016-05-26')
WHERE CONVERT(DATE,CreateDate)='2016-05-24'
运行这条语句就会把CreateDate字段中日期更改而时间不变