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) (day, (ABS (checks (newed) 65530), 0)

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).

< P> Edit: this Update

  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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -