The most likely cause of this sort of problem is that the time in the table is not
precisely 15:35:26
, but includes milliseconds as well. Replacing the
DELETE
with a
SELECT
will show you whether any rows match the condition.
It's also a good idea to use an unambiguous date format in your queries, to ensure that the
DATEFORMAT
setting doesn't affect how the date is interpreted. The best format to use is
yyyyMMdd
, without any separators.
To delete the rows which match up to the second, ignoring milliseconds, you'll need to use a date range:
DELETE
FROM tableName
WHERE [DateTime] >= '20140703 15:35:26'
And [DateTime] < '20140703 15:35:27'