views:

1652

answers:

3

How can i get the table creation date of a MS SQL table using a SQL query ?

I could not see any table physically but i can query that particular table

A: 
SELECT create_date
FROM sys.tables
WHERE name='YourTableName'
AdaTheDev
+1  A: 

For 2005 up, you can use

SELECT
        [name]
       ,create_date
       ,modify_date
FROM
        sys.tables

I think for 2000, you need to have enabled auditing.

Galwegian
A: 

For SQL Server 2005 upwards:

SELECT [name] AS [TableName], [create_date] AS [CreatedDate] FROM sys.tables

For SQL Server 2000 upwards:

SELECT so.[name] AS [TableName], so.[crdate] AS [CreatedDate]
FROM INFORMATION_SCHEMA.TABLES AS it, sysobjects AS so 
WHERE it.[TABLE_NAME] = so.[name]
adrianbanks