Friday, June 21, 2013

Difference between STUFF and REPLACE in SQL Server?

Posted by Rahul Kharde at 2:23 AM

REPLACE is used to replace all the occurrences of the given pattern in a string.


SELECT REPLACE('Hello i am here','H','m')
-- mello i am mere

STUFF used to replace the part of string with some other string.

SELECT STUFF('Hello i am here',1,5,'Hi')
-- Hi i am here

If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you subscribe to my regular Email Updates. Subscribe Now!

Kindly Bookmark and Share it:



Gadwin Co Inger on November 3, 2017 at 6:46 AM said...

This is an amazing blog,it gives very helpful messages to us.Besides that Wisen has established as Best Dot Net Training in Chennai. or learn thru ASP.NET Online Training . Nowadays Dot Net has tons of job opportunities on various vertical industry.

Have any question? Feel Free To Post Below:


Popular Posts

Recent Comments

© 2011. All Rights Reserved | Help to understand .Net | Template by Blogger Widgets

Home | About | Top