<tfoot id='RZc61'></tfoot>
    <legend id='RZc61'><style id='RZc61'><dir id='RZc61'><q id='RZc61'></q></dir></style></legend>
    • <bdo id='RZc61'></bdo><ul id='RZc61'></ul>

    <i id='RZc61'><tr id='RZc61'><dt id='RZc61'><q id='RZc61'><span id='RZc61'><b id='RZc61'><form id='RZc61'><ins id='RZc61'></ins><ul id='RZc61'></ul><sub id='RZc61'></sub></form><legend id='RZc61'></legend><bdo id='RZc61'><pre id='RZc61'><center id='RZc61'></center></pre></bdo></b><th id='RZc61'></th></span></q></dt></tr></i><div id='RZc61'><tfoot id='RZc61'></tfoot><dl id='RZc61'><fieldset id='RZc61'></fieldset></dl></div>

      <small id='RZc61'></small><noframes id='RZc61'>

      SQL Server 中的 DateTime2 与 DateTime

      DateTime2 vs DateTime in SQL Server(SQL Server 中的 DateTime2 与 DateTime)
      <legend id='9fZ1C'><style id='9fZ1C'><dir id='9fZ1C'><q id='9fZ1C'></q></dir></style></legend>
        <i id='9fZ1C'><tr id='9fZ1C'><dt id='9fZ1C'><q id='9fZ1C'><span id='9fZ1C'><b id='9fZ1C'><form id='9fZ1C'><ins id='9fZ1C'></ins><ul id='9fZ1C'></ul><sub id='9fZ1C'></sub></form><legend id='9fZ1C'></legend><bdo id='9fZ1C'><pre id='9fZ1C'><center id='9fZ1C'></center></pre></bdo></b><th id='9fZ1C'></th></span></q></dt></tr></i><div id='9fZ1C'><tfoot id='9fZ1C'></tfoot><dl id='9fZ1C'><fieldset id='9fZ1C'></fieldset></dl></div>

        • <small id='9fZ1C'></small><noframes id='9fZ1C'>

          <tfoot id='9fZ1C'></tfoot>
            <tbody id='9fZ1C'></tbody>

              • <bdo id='9fZ1C'></bdo><ul id='9fZ1C'></ul>

                本文介绍了SQL Server 中的 DateTime2 与 DateTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                哪个:

                • 日期时间
                • datetime2

                推荐的在 SQL Server 2008+ 中存储日期和时间的方法吗?

                is the recommended way to store date and time in SQL Server 2008+?

                我知道精度(可能还有存储空间)的差异,但暂时忽略这些差异,是否有关于何时使用什么的最佳实践文档,或者我们应该只使用 datetime2只有?

                I'm aware of differences in precision (and storage space probably), but ignoring those for now, is there a best practice document on when to use what, or maybe we should just use datetime2 only?

                推荐答案

                datetime 建议使用 datetime2.这是他们的建议:

                The MSDN documentation for datetime recommends using datetime2. Here is their recommendation:

                使用 timedatedatetime2datetimeoffset 新数据类型工作.这些类型与 SQL标准.它们更便携.timedatetime2datetimeoffset提供更多的秒精度.datetimeoffset 提供时区支持全球部署应用程序.

                Use the time, date, datetime2 and datetimeoffset data types for new work. These types align with the SQL Standard. They are more portable. time, datetime2 and datetimeoffset provide more seconds precision. datetimeoffset provides time zone support for globally deployed applications.

                datetime2 具有更大的日期范围、更大的默认小数精度和可选的用户指定精度.此外,根据用户指定的精度,它可能会使用较少的存储空间.

                datetime2 has larger date range, a larger default fractional precision, and optional user-specified precision. Also depending on the user-specified precision it may use less storage.

                这篇关于SQL Server 中的 DateTime2 与 DateTime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Select n random rows from SQL Server table(从 SQL Server 表中随机选择 n 行)
                SQL query to select dates between two dates(用于选择两个日期之间的日期的 SQL 查询)
                How can I delete using INNER JOIN with SQL Server?(如何在 SQL Server 中使用 INNER JOIN 进行删除?)
                Table Naming Dilemma: Singular vs. Plural Names(表命名困境:单数与复数名称)
                INSERT statement conflicted with the FOREIGN KEY constraint - SQL Server(INSERT 语句与 FOREIGN KEY 约束冲突 - SQL Server)
                How ROWNUM works in pagination query?(ROWNUM 如何在分页查询中工作?)

                <legend id='1zHvP'><style id='1zHvP'><dir id='1zHvP'><q id='1zHvP'></q></dir></style></legend>
                <i id='1zHvP'><tr id='1zHvP'><dt id='1zHvP'><q id='1zHvP'><span id='1zHvP'><b id='1zHvP'><form id='1zHvP'><ins id='1zHvP'></ins><ul id='1zHvP'></ul><sub id='1zHvP'></sub></form><legend id='1zHvP'></legend><bdo id='1zHvP'><pre id='1zHvP'><center id='1zHvP'></center></pre></bdo></b><th id='1zHvP'></th></span></q></dt></tr></i><div id='1zHvP'><tfoot id='1zHvP'></tfoot><dl id='1zHvP'><fieldset id='1zHvP'></fieldset></dl></div>
                  • <bdo id='1zHvP'></bdo><ul id='1zHvP'></ul>

                    <small id='1zHvP'></small><noframes id='1zHvP'>

                    <tfoot id='1zHvP'></tfoot>
                      <tbody id='1zHvP'></tbody>