sql - How to update rows with a random date -
I have a simple SQL table in which there is a datetime column I with all the rows (> 100000 rows) with a random date Would you like to update whether this is an easy way to do a SQL query?
Use it to create a small time between 01 January 1900 and 06 June 2079 ( Not checked, SQL is not installed) NEWID Better then trying to use RAND: the rand does not generate different values in single selection or update (it did not work correctly in SQL 2000, because the behavior has changed).
Update Table SET datetimecol = DATEADD (day, (ABS (Czechs (Nude) 65530), 0) Edit: 65535 Was changed to 65530 and ABS was added to avoid overflow over the upper limit of the border
Comments
Post a Comment