Difference between STUFF & REPLACE function

0 votes
Hi!!

Can someone tell the difference between the STUFF and REPLACE function.
Oct 10, 2018 in Database by DataKing99
• 8,130 points
731 views

1 answer to this question.

0 votes

STUFF Function: This function is used to overwrite existing character or inserts a string into another string. Syntax:

STUFF(string_expression,start, length, replacement_characters)

where,

  • string_expression: it is the string that will have characters substituted
  • start: This refers to the starting position
  • length: It refers to the number of characters in the string which are substituted.
  • replacement_string: They are the new characters which are injected in the string.

REPLACE function: This function is used to replace the existing characters of all the occurrences. 

Syntax:

REPLACE (string_expression, search_string, replacement_string)
answered Oct 10, 2018 by CodingByHeart77
• 3,690 points

Related Questions In Database

0 votes
1 answer

Difference between Inner Join & Outer Join

The difference is as follows: INNER JOIN: Returns all those ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,130 points
110 views
0 votes
1 answer

STUFF and REPLACE function in SQL

STUFF Function: This function is used to ...READ MORE

answered Sep 27, 2018 in Database by DataKing99
• 8,130 points
92 views
0 votes
1 answer

Difference between clustered and non clustered index in SQL

The differences between the clustered and non ...READ MORE

answered Sep 28, 2018 in Database by darklord
• 6,170 points
108 views
+1 vote
1 answer

Difference between cross join and natural join

The cross join produces the cross product ...READ MORE

answered Oct 12, 2018 in Database by DataKing99
• 8,130 points
2,757 views
0 votes
1 answer

Which query to use for better performance, join in SQL or using Dataset API?

DataFrames and SparkSQL performed almost about the ...READ MORE

answered Apr 19, 2018 in Apache Spark by kurt_cobain
• 9,260 points
129 views
0 votes
1 answer

How to connect Java program to the MySQL database?

You can connect your Java code with ...READ MORE

answered May 11, 2018 in Java by parth295
• 4,640 points
209 views
0 votes
1 answer
0 votes
1 answer

Automating Oracle script with nolio

Depending upon the details of your script ...READ MORE

answered Jul 17, 2018 in Other DevOps Questions by ajs3033
• 7,280 points
62 views
0 votes
1 answer

Difference between primary key a composite key

Primary key is that column of the table ...READ MORE

answered Sep 5, 2018 in Database by CodingByHeart77
• 3,690 points
1,728 views
0 votes
1 answer

Difference between single and double quotes in SQL

Single quotes are used to indicate the ...READ MORE

answered Sep 11, 2018 in Database by CodingByHeart77
• 3,690 points
93 views