I'm developing an ASP.NET webforms application using C#, and I have two tables in SQL Server, terms
and descriptions
.
CREATE TABLE Terms
(
[TermId] [int],
[TermLable] [varchar](50)
);
CREATE TABLE Descriptions
(
[DescriptionId] [int],
[Descriptions] [varchar](MAX)
);
First table includes terms (more than 10K) such as
1 JAVA
2 C++
3 ASP.NET
4 Linux
5 web development
6 programming language
The second table include descriptions such as :
1 Java is the one of the most popular programming languages in the world today. It works on any platform (Windows, Mac, Linux, etc), and is the core language used in developing Android apps. It's a great first language for any aspiring programmer, so whether you want to program Android apps, web apps, or simply learn the foundational skills that all programmers use, this course is a great place to start!
2 This course teaches C++ to students already familiar with a programming language. Students will learn how to use header files, control flow, functions, classes.
I want to create query that searches in each description and finds the matching terms from the first table. so the result would be something like:
The matching terms in first sentence:
JAVA
Linux
The matching terms in second sentence:
C++
programming language
I really tried to think of a way to do this using select %like% but that only works for me with specific terms .. I could not figure out a way of including all these terms from a column.
What is the best possible way of doing it?