Jan 2, 2014

Sql query to list all the user defined tables in database which has been created before or after given table in sql server


Sql query or script to list out or get all the user defined tables in database which has been created before or after given or specified table in sql server

Sql query to get the list of tables which has created before the specified date.

SELECT name FROM sys.tables WHERE create_date >= '2011-11-05'

Sql query to get the list of tables which has created after the specified date.

SELECT name FROM sys.tables WHERE create_date <= '2011-11-05'

Here sys.tables is system view. sys.tables keeps only user defined tables of a database.

Create_date: It is datetime type column which keeps the information regarding the date of creation of any table in the database.

No comments:

Post a Comment