To meet a requirement like this, modify the parent folder name to update all the child node names.
The rule is to leave the child node pressed-the last element after the split is unchanged, and the preceding string is updated to the parent node name.
Such as:
If I modify the parent node "Southeast Network-west Coast commentary test", "Southeast Network Test", then the following node should have such a result:
The SQL statement that was originally processed:
Update websiteb set websitename=websitename where [email protected]
Obviously not enough, with stored procedures, involving cursor traversal, but also to check again to the temporary table, performance and design are not satisfied.
If it is found in the code to deal with, but also need to produce multiple execution statements for the results, it is not reasonable.
Therefore, the SQL function is intended to be used to process the value to be updated on the original SQL statement:
The SQL statement for the function is posted below:
Here is the main introduction of the next Revese (') function, SQL has a indexof function, but there is no lastindexof function.
If you want to implement a similar lastindexof function, we can first sort the string upside down and get the indexof value.
"1234," –> ', 4321 '
Indexof=1
Lastindexof=len (1234,) -1=4
The Revese () function is the ability to implement this inverted string.
With this little skill, the above needs can be solved more gracefully.
How to split strings in SQL statements for substitution