January 19, 2019 at 4:21 pm
I am testing out the datetime2 data type so I can understand how the precision works. I have defined a small table as follows.
Then I got into Edit mode and I entered a date and time. What is causing these errors?
January 19, 2019 at 4:57 pm
Those aren't errors. Hover the mouse pointer of one of those Red dots and see.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 19, 2019 at 5:47 pm
Jeff Moden - Saturday, January 19, 2019 4:57 PMThose aren't errors. Hover the mouse pointer of one of those Red dots and see.
I entered another row. See the 3rd row. The first column should go out to 4 digits past the decimal. The second column should go out to 3 digits and the third column should go out to 5 digits. However, after I tabbed out of these fields, all 7 digits past the decimal were retained. Why didn't these truncate the way they are supposed to based on the precisions I specified in the screenshot in my original post?
Here is the message from doing a mouse over from the results above. Why did SQL try to retrieve the data back after the commit?
January 19, 2019 at 7:00 pm
michael.leach2015 - Saturday, January 19, 2019 5:47 PMJeff Moden - Saturday, January 19, 2019 4:57 PMThose aren't errors. Hover the mouse pointer of one of those Red dots and see.I entered another row. See the 3rd row. The first column should go out to 4 digits past the decimal. The second column should go out to 3 digits and the third column should go out to 5 digits. However, after I tabbed out of these fields, all 7 digits past the decimal were retained. Why didn't these truncate the way they are supposed to based on the precisions I specified in the screenshot in my original post?
Here is the message from doing a mouse over from the results above. Why did SQL try to retrieve the data back after the commit?
Beats me. I don't use the editor for such things. It's faster to type code.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 20, 2019 at 10:28 am
michael.leach2015 - Saturday, January 19, 2019 5:47 PMJeff Moden - Saturday, January 19, 2019 4:57 PMThose aren't errors. Hover the mouse pointer of one of those Red dots and see.I entered another row. See the 3rd row. The first column should go out to 4 digits past the decimal. The second column should go out to 3 digits and the third column should go out to 5 digits. However, after I tabbed out of these fields, all 7 digits past the decimal were retained. Why didn't these truncate the way they are supposed to based on the precisions I specified in the screenshot in my original post?
Here is the message from doing a mouse over from the results above. Why did SQL try to retrieve the data back after the commit?
This is just another reason to not use the editor - it is set to display datetime2 data types with full precision, but if you look at the actual time it is truncated to 4 places. Open a query window and select directly from the table and you will see that the values only have 4 digits past the decimal.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply