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:


No comments:

Post a Comment