查找表列的创建日期/时间 [英] Find the date/time a table's column was created
问题描述
如何查询 SQL Server 以获取 SQL Server 2005 表列的创建日期?
How can you query SQL Server for the creation date for a SQL Server 2005 table column?
我尝试使用 sp_columns [tablename]
来获取该信息,但此存储过程中未包含创建日期.
I tried the sp_columns [tablename]
to get that information, but the creation date wasn't included in this stored procedure.
如何做到这一点?
推荐答案
有一个名为 sys.Columns 的系统表,您可以从中获取列信息.如果您想查看特定表的列,您可以执行以下操作:
There's this system table named sys.Columns that you can get columns information from it. if you want to see columns of a particular table you can do as follows:
SELECT col.* from sys.objects obj
inner join sys.columns col
on obj.object_Id=col.object_Id
and obj.Name=@tableName
或者你可以像这样获取表格信息:
Or you can get table information like this:
SELECT * FROM sys.objects WHERE Name=@tableName
但我找不到有关列创建日期的任何信息.
but I couldn't find any information on creation date of a column.
更新:这个可能会有所帮助.
Updated: This might help.
这篇关于查找表列的创建日期/时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!