SQL Server Date field considerations for Query flag fields

Source: Internet
Author: User
Tags string format

Today in a data extraction program encountered a problem for a long time to solve, this is not a technical problem, but common sense and careful questions. Write it up so that everyone can pay attention to it.

Because the previous program was long-term with Oracle, and the data marker field takes the date type. In Oracle, the date format is basically "date and time", so my program also uses the string format date format "Yyyy_mm-dd HH:mm:ss"

But this time swap with SQL Server, the program also as usual in this way to extract data, the results found every time the data are revisited, toss a long, and finally found that SQL Server date field contains a millisecond value. So I'm going to revisit the last few pieces of data every time.

There were two reasons for the post-mortem analysis.

1: Inertia thinking due to long-term use of Oracle's date format.

2: In fact, many times the SQL Server value, also see the millisecond value, but did not think, thought is to save the maximum value, the next time to extract data from the maximum. Too careless to be caused.

SQL Server Date field considerations for Query flag fields

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.