I'm trying to achieve something like the following:SELECT 'page' as type, page_filename as filename, page_title as title, page_metadescription as introFROM tbl_pagesWHERE CONTAINS(*, @searchterm)IF 1=1 BEGINUNION allSELECT 'news' as type, 'thiswillbeafilename.asp' as filename, news_title as title, news_intro as introFROM tbl_newsWHERE CONTAINS(*, @searchterm)ENDIF 2=2 BEGINUNION ALLSELECT 'resource' as type, resource_filename as filename, resource_longtitle as title, resource_summaryFROM tbl_resourcesWHERE CONTAINS(*, @searchterm)END
I'm pretty sure this isn't possible using the approach i have here, however is there an different method i can use to ahcieve the same effect other than using dynamic sql?Cheers,