HTTPRequestURIStem is the column contains file path, e.g. /webpage/default.aspx
SQL
-
REVERSE(SUBSTRING(REVERSE(REVERSE(SUBSTRING(REVERSE(HTTPRequestURIStem),0,
-
CHARINDEX(‘/’,REVERSE(HTTPRequestURIStem))))),0,
-
CHARINDEX(‘.’,REVERSE(REVERSE(SUBSTRING(REVERSE(HTTPRequestURIStem),0,
-
CHARINDEX(‘/’,REVERSE(HTTPRequestURIStem))))))))
This function will return “aspx” for “/webpage/default.aspx”.
NOTICE: I put the code in seperate lines for readablity.
Source: chenty