Showing posts with label query. Show all posts
Showing posts with label query. Show all posts

Tuesday, April 24, 2012

Query to get FileName from URL (in SQL Server)

There are queries to get the file name from a column named: 'ImageUrl' containing list of image Url.

SELECT imageurl
  ,reverse(left(reverse(imageurl), charindex('/', reverse(imageurl)) -1)) as 'File Name'
 from [e_Image]

And result as the following: