Difference
between STUFF and REPLACE in SQL Server
-
S.NoSTUFFREPLACE
1 STUFF is used to replace the part of string with some other string.REPLACE is used to replace all the occurances of the given pattern in a string.2Syntax:
STUFF (stringexpression, start, length, replacementcharacters)
Example:
SELECT STUFF('Umar's Blog is USEFUL',8,4,'DATABASE')
Output:Umar's DATABASE is USEFULSyntax:
REPLACE ( string_expression , string_pattern , string_replacement )
Example:
select Replace('Umar','U','A')
Output: Amar
Nice explanation thank you
ReplyDelete"Nice and good article.. it is very useful for me to learn and understand easily.. thanks for sharing your valuable information and time.. please keep updating.php jobs in hyderabad.
ReplyDelete"
perfectly explained
ReplyDelete