How to check if a column exists in a Sql Server table?

How to check if a column exists in a Sql Server table?

If you have a situation where you want to add a column into a table in SQL Server, it would be a good idea to perform a check first if a column has already existed in a table. Otherwise, if you try to add a duplicate column, you may get an error message when you try to add a column via SQL query.

How to order the SQL query result by best match keyword search?

How to order the SQL query result by best match keyword search?

If you develop a website or a program that allows your users to perform a search. When the users perform a search query, you probably want to return the best match result first because it is actually more relevant to the search they need. For example, let says we have a database table contains the following list of product.