To get a specific string from a string column

First you need to get the starting position of your string by CharIndex like:
CHARINDEX('https:',FeedBody,1)

Then you need to get the ending position of your string like:
CHARINDEX('?AWS',FeedBody,1)

Now you  have to Use SUBSTRING function to find your desired string by giving the starting and ending point in it which you get from CHARINDEX. like:

select
SUBSTRING(FeedBody,CHARINDEX('https:',FeedBody,1),CHARINDEX('?AWS',FeedBody,1)-CHARINDEX('https:',FeedBody,1))
 from
 feeds

Comments

Popular posts from this blog

TSQL To Get All the Names of tables and Databases whose data have changed in last 24 Hours

To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases

Apply paging in procedure