top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What is the STUFF Function and How it differ from the REPLACE Function?

+2 votes
59 views
posted Sep 10, 2014 by Khusboo

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer

STUFF function is used to insert a string into another string by deleting some characters specified whereas REPLACE instead of replacing specific characters, replaces existing characters of all occurrences.

Stuff function Syntax:

STUFF (character_expression , start , length , replace_expression )

Example

Select Stuff ('QueryHome', 3, 3, 'abc')
This query will return the string "QuabcHome".

Replace Function Syntax:

REPLACE ( string_expression , string_pattern , string_replacement )

Example:

Select Replace ('abcabcabc', 'bc', 'xy')
This query will return the string axyaxyaxy.
answer Sep 10, 2014 by Salil Agrawal
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...