MySQL: Update a full table, inserting a MD5 hash, for each row a specific one
Try this:
UPDATE yourtableSET hash = MD5(name)WHERE hash IS NULL
Note that the test is hash IS NULL
and not hash = NULL
as you wrote in your question.
No need write an extra query for update.
- Just go to table design
- create a new column
- select new created column, below you'll get properties
- Find for computed Column Specification
- Under above opt you'll find formula section write HashBytes([Algo], [ColumnName])
it will automatically create an hash value for rows which are already present.