Search for keyword in DB


(Nic Hubbard) #1

We just found that the keyword %asset_href% was causing some issues for public users, and would like to change all references to %asset_url%. (Years ago we used %asset_href%, not sure why)


Does anyone know how to write a DB query to search for %asset_href% and replace it with %asset_url%? Or at least give a list of the asset ID's so I can do it manually?



Thank you!


(Dan Simmons) #2

I'd recommend getting a list of asset IDs and changing them manually.


You can do that with this query:


    
    SELECT assetid FROM sq_ast_attr_val WHERE custom_val LIKE '%\%asset_href\%%';



While it's very easy to do a replace in SQL, bodycopy divs also store information on the filesystem (eg. for paint layouts, designs), so you can't just replace them in the DB.

(Nic Hubbard) #3

[quote]
I'd recommend getting a list of asset IDs and changing them manually.



You can do that with this query:


    
    SELECT assetid FROM sq_ast_attr_val WHERE custom_val LIKE '%\%asset_href\%%';



While it's very easy to do a replace in SQL, bodycopy divs also store information on the filesystem (eg. for paint layouts, designs), so you can't just replace them in the DB.
[/quote]

This worked perfectly. Thank you so much!