Skip to content

REPLACE STRING IN SQL SERVER 2005

May 12, 2009

sql_server_logo

REPLACE

Replaces all occurrences of the second given string expression in the first string expression with a third expression.

Syntax


REPLACE ( 'string_expression1' , 'string_expression2' , 'string_expression3')


Examples

This example replaces the string in “Testing Replace String” with Testing Replace String

SELECT REPLACE('"Testing Replace String"','"','')
GO

Here is the result set:

------------
Testing Replace String
(1 row(s) affected)

Another example is in the following code,
Sql-Server
Advertisement
4 Comments leave one →
  1. zuntuk06 permalink
    May 16, 2009 5:52 am

    hohohohoo …

    jadi ingat pelajaran DBS neh bang…

    • dedirahmans permalink*
      May 17, 2009 9:14 am

      Upps… master ngasi comment :)
      Jadi segan awak posting di blog..
      Tapi ga cupu2 x postingannya kan? He he he..

      Kapan KP kalian di?

  2. zuntuk06 permalink
    May 18, 2009 9:29 am

    minta dibilang abang ini bah ….
    nice posting kok bang, makain mantap aja abang ini makin lama bah.

    tanggal 30 berangkat dari del.

  3. June 3, 2009 4:31 am

    master kali lah kw ded. bangga awak jadi teman samping kanan pas di lk IS kemaren. ada kawan awak yang sudah jadi konsultan dan semakin menggila aja ilmunya

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.