Skip to content
Advertisement

Query to find tables created in the last hour

I want to find out which tables have been created in the last hour in a MS SQL Server database. How can I do this?

Advertisement

Answer

You can query sys.tables.

SELECT
    T.*
FROM
    sys.tables AS T
WHERE
    T.create_date >= DATEADD(HOUR, -1, GETDATE())

Will just give you results of the currently connected database.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement