Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: Global find/replace? SQL query? Need to replace common text/code.

  1. #1
    biohealth is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2

    Default Global find/replace? SQL query? Need to replace common text/code.

    Hello, I have about 80 products, each with its page's code in the Description section of the admin backend.

    Now I need to change a hyperlink that appears around the same image on ever page.

    How do I change that common code short of going to each and every page?

    Much thanks,
    Bryan

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    If I understand this exactly, you want to have a global find/replace on the product in your DB which contains a certain text? To find them, you can run a sql query and use a 'like' function (e.g. Select * from table where description like 'http' - this should return all products that have http on their descriptions).

  3. #3
    btappan is offline Senior Member
    Join Date
    Jan 2008
    Posts
    148

    Default

    UPDATE Product
    SET Description = Replace(Cast(Description AS NVARCHAR(Max)),
    'YOUR OLD TEXT GOES HERE',
    'YOUR NEW TEXT GOES HERE')

    This works good, it solves the common problem of not being aable to replace ntext data. It will find your old text in the descriptions and replace it with the new text you specify.
    Last edited by btappan; 03-04-2010 at 07:34 PM.

  4. #4
    biohealth is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2

    Default

    Thanks for the replies.

    I want to be able to replace text or code. I also need to be able to do this in the Extension Data...or Summary.

    I'll try the SQL and check back in.