Wednesday, 8 March 2017

Filter or Search SQL table using SQL Query

In this article, I will explain how to filter table with containing text in SQL server database using SQL query.  

To filter all table which contains given text in SQL server we need to write query using SYS.TABLES table.

SQL Query :

DECLARE @Parameter VARCHAR(100)      
SET @Parameter = 'employee'

SELECT * FROM SYS.TABLES      
WHERE NAME LIKE '%'+ @PARAMETER +'%'      
ORDER BY MODIFY_DATE DESC


Related Posts:

  • SQL Delete StatementIn this post, I will explain the SQL Delete Statement. DELETE statement is used to delete a single or multiple rows from a table. We can use where cla… Read More
  • Difference between Primary Key and Unique Key? In this post, I will explain the difference between Primary Key and Unique Key. Primary Key and Unique Key provide uniqueness for a column… Read More
  • What is Database Schema?In this post, I will explain what is Database Schema? A Database Schema represents the logical structure of all or part of a relational data… Read More
  • SQL Truncate StatementIn this post, I will explain the SQL Truncate Statement. The Truncate statement is used to remove all records from a table. It performs the same funct… Read More
  • What is Database? In this post, I will explain What is Database? A Database is a collection of organized information that is stored in a computer so that … Read More

0 comments:

Post a Comment

Please do not enter any spam link in the message box.