Re: Partial String Update

From: Ray Higdon (sqlhigdon_at_nospam.yahoo.com)
Date: 03/17/04

  • Next message: Vishal Parkar: "Re: How to limit the number of sql statements ?"
    Date: Tue, 16 Mar 2004 19:02:09 -0500
    
    

    An example:

    create table sites (site varchar(100))

    insert into sites select 'http://www.go.com'
    insert into sites select 'http://www.mimim.com'
    insert into sites select 'http://www.gone.com'

    update sites set site = replace(site,'http','https')

    select * from sites

    -- 
    Ray Higdon MCSE, MCDBA, CCNA
    ---
    "scmiles" <anonymous@discussions.microsoft.com> wrote in message
    news:e46101c40b94$a347e600$a401280a@phx.gbl...
    > Hello, I am trying to figure out how to write a query
    > that can update only part of a string in a given column.
    >
    > Example:
    > Table = WebSites
    > Column = url
    >
    > Exsiting record = http://www.site.com
    > Needs updated to = https://www.site.com
    >
    > or
    >
    > Exsiting record = http://servername/pathX
    > Needs updated to = https://www.site.com/pathX
    >
    > I need to do this for every record in the table.
    >
    >
    

  • Next message: Vishal Parkar: "Re: How to limit the number of sql statements ?"