declare @X datetime set @X = '2012-01-25 17:24:05.784' select convert(datetime, convert(char(19), @X, 126))
select dateadd(millisecond, -datepart(millisecond, @X), @X)