How to use substring and len function in sql server 2005 or 2008 — Len , Sql Server , Substring — ASP.Net Example
ASP.Net Example-How to use substring and len function in sql server 2005 or 2008

Sunday, July 8, 2012

How to use substring and len function in sql server 2005 or 2008

I am giving one example from that you will understand How to use Substring and Len Funcation.
Suppose I have one table employee with 1000 of Record. and Having one Column Name is stImage.
This column contain link of Image. stImage contain data like http://www.example.com/images/sqlserversubstring.jpg now I want to change only domain name only replace with http://aspdotnet-example.com/images/sqlserversubstring.jpg for that we will do
update employee set stImage= 'http://aspdotnet-example.com'+
SUBSTRING(stImage,len('http://www.example.com'),len(stImage))
from employee

2 comments:

  1. What you're saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I'm sure you'll reach so many people with what you've got to say.

    ReplyDelete
  2. I really appreciate your professional approach. These are pieces of very useful information that will be of great use for me in future.

    ReplyDelete

ASPdotNET-Example