I have a table called MyTable.
I want to update comments value for the rows that ends with '[address]' and '[phone]' from the paths specified in 'directory' column.
MyTable looks like this.
ID| directory |Comments
1 | A\B\C\D\[address] |Jason
2 | E\F\G\K\[[bank] |Poland
3 | H\I\J\L\[phone] |Tree
4 | AA\CA\BB\D\[county] |Oregon is near!
5 | KI\Y\Z\NC\[salary] |
I used the query like
Update MyDB.dbo.MyTable set comments = 'MyFolder'
Where directory like '%address]' or
directory like '%phone]'
This actually works fine. However, is there any part that I need to modify my script so that it becomes more efficient/elegant code?