Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Datetime in sqlserver

Datetime in sqlserver

Scheduled Pinned Locked Moved Database
helpannouncement
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kurangu
    wrote on last edited by
    #1

    folks, I have a table with column upddate with datatype as datetime. I updated the table update table set upddate=getdate() when i select the values all the upddates are same. I expected difference in milli seconds to find the last updated record. can somebody help me out.

    N A 2 Replies Last reply
    0
    • K kurangu

      folks, I have a table with column upddate with datatype as datetime. I updated the table update table set upddate=getdate() when i select the values all the upddates are same. I expected difference in milli seconds to find the last updated record. can somebody help me out.

      N Offline
      N Offline
      Neeraj Kr
      wrote on last edited by
      #2

      Actually, your expectation is not wrong. But the effect can only be seen if there are millions of records. For lesser number of rows, it will reflect the same time.

      -----Have A Nice Day-----

      1 Reply Last reply
      0
      • K kurangu

        folks, I have a table with column upddate with datatype as datetime. I updated the table update table set upddate=getdate() when i select the values all the upddates are same. I expected difference in milli seconds to find the last updated record. can somebody help me out.

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        Simple really, the update happened so quickly they are all the same time. Also be warned, SQL Server is only accurate (from memory) to a third of a millisecond.

        Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

        D D 2 Replies Last reply
        0
        • A Ashfield

          Simple really, the update happened so quickly they are all the same time. Also be warned, SQL Server is only accurate (from memory) to a third of a millisecond.

          Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          Ashfield wrote:

          SQL Server is only accurate (from memory) to a third of a millisecond.

          That's a good information to have. Thanks.

          1 Reply Last reply
          0
          • A Ashfield

            Simple really, the update happened so quickly they are all the same time. Also be warned, SQL Server is only accurate (from memory) to a third of a millisecond.

            Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

            D Offline
            D Offline
            David Skelly
            wrote on last edited by
            #5

            Actually, DATETIME in SQL Server is only accurate to about 3 milliseconds. Which is not very accurate at all, in computing terms. There is a new datatype called DATETIME2 in the latest version of SQL Server which is accurate down to nanoseconds. Hundreds of highly trained database experts worked for weeks to come up with that name for the new datatype.

            A 1 Reply Last reply
            0
            • D David Skelly

              Actually, DATETIME in SQL Server is only accurate to about 3 milliseconds. Which is not very accurate at all, in computing terms. There is a new datatype called DATETIME2 in the latest version of SQL Server which is accurate down to nanoseconds. Hundreds of highly trained database experts worked for weeks to come up with that name for the new datatype.

              A Offline
              A Offline
              Ashfield
              wrote on last edited by
              #6

              I knew 3 and milliseconds came into, just couldn't remember where. I knew about datetime2 in 2008, but didn't realise so much time had been spent deciding on a name :-D

              Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups