SQL Server表创builddate查询
如何使用SQL查询获取MS SQL表的表创builddate?
我看不到任何物理表,但我可以查询该特定的表。
对于2005年,你可以使用
SELECT [name] ,create_date ,modify_date FROM sys.tables
我想2000年,你需要启用审计。
对于SQL Server 2005向上:
SELECT [name] AS [TableName], [create_date] AS [CreatedDate] FROM sys.tables
对于SQL Server 2000向上:
SELECT so.[name] AS [TableName], so.[crdate] AS [CreatedDate] FROM INFORMATION_SCHEMA.TABLES AS it, sysobjects AS so WHERE it.[TABLE_NAME] = so.[name]
SELECT create_date FROM sys.tables WHERE name='YourTableName'
对于SQL Server 2000:
SELECT su.name,so.name,so.crdate,* FROM sysobjects so JOIN sysusers su ON so.uid = su.uid WHERE xtype='U' ORDER BY so.name