In this article I will explain how to write query to use update statement with Replace function in SQL Server.
To know about Replace function check this post Replace() function example in SQL Server
SELECT
REPLACE(' Dasari
Suresh', 'Dasari', 'Aspdotnet')
|
In above query we declared string as 'Dasari Suresh', and we tried to replace string part 'Dasari' to 'Aspdotnet' string value.
UserName
|
Location
|
Website
|
Suresh
Dasari
|
Chennai
|
http//www.aspdotnet-suresh.com
|
Mahesh
|
Vijayawada
|
http//www.usefulcorner.com
|
Mahendra
|
Guntur
|
http//www.test.com
|
UPDATE SampleDetails SET
Website=REPLACE(Website,'http//www.','http://www.')
|
UserName
|
Location
|
Website
|
Suresh
Dasari
|
Chennai
|
http://www.aspdotnet-suresh.com
|
Mahesh
|
Vijayawada
|
http://www.usefulcorner.com
|
Mahendra
|
Guntur
|
http://www.test.com
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
|
Subscribe by RSS
Subscribe by Email
0 comments :