sql server - How to filter the SQL query result using regular expression or SQL functions -
i have got below types of urls:
/fullnews/news/english/2014/2014.xml /fullnews/news/english/2014/1221264.xml /fullnews/news/english/2014/1221272.xml /fullnews/news/english/2013/2013.xml /fullnews/news/english/2013/1251272.xml /fullnews/news/english/2012/2012.xml /fullnews/news/english/2012/1281272.xml /fullnews/news/english/config.xml /fullnews/news/english/list.xml
now need write sql procedure pass "fullnews" parameter , procedure return below results
getdata("fullnews");
/fullnews/news/english/2014/1221264.xml /fullnews/news/english/2014/1221272.xml /fullnews/news/english/2013/1251272.xml /fullnews/news/english/2012/1281272.xml
it should filter ther urls last part not numeric (config,list etc.) , should not return urls last part (2014,2013,2012 etc.) else (1281272, 1221264 etc.) need rendered.
create procedure p_test ( @parameter varchar(400) ) begin select * <tablename> url '/'+@parameter+'/news/english/20[0-2][2-9]/[0-9][0-9][0-9][0-9]_%.xml' end
Comments
Post a Comment