编写一个查询,从包含日期的表中提取所有字段
我有大约 100 多个字段的表。其中有许多分散的日期字段(我怀疑大约有 8 个或更多)。我想要一个查询或 StoredProcedure 仅选择数据类型为日期或日期时间的字段。
这不是Project的要求,它只是我的分析工具。
我正在使用 MSSQL 2005,但它不必仅在 MSSQL 中。
I have table with about 100+ fields. There are a number of date fields in it scattered around (I am suspecting about 8 or more). I would like to have a query or StoredProcedure that selects only those fields whose data type is Date or Datetime.
This is not a requirement from Project, it will only be my analysis tool.
I am using MSSQL 2005 but it does not have to be only in MSSQL.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以查询元数据:
此外,此
information_schema.columns
在其他数据库系统中也可用。You can query the metadata:
Also, this
information_schema.columns
is available in other database systems.