• First of all, you can't add a milisecond to a datetime, you need to use datetime2.

    Here's an example, if you remove the CAST, you'll see what I mean.

    SELECT TOP (500) DATEADD( ms, ROW_NUMBER() OVER (ORDER BY s1.[object_id]), CAST('2013-07-30 08:20:40:010' AS datetime2))

    FROM sys.all_objects AS s1

    CROSS JOIN sys.all_objects AS s2

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2