This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi all - I noticed the new SQL Server editions (2008 on) support and recommend using the new datetime type, called out as DATETIME2(x) where x is the optional user-defined precision. From what I understand this new type allows for greater default fractional second precision as well as allowing the user to specify the precision. So I have 2 questions. 1) Does Lightspeed 5 support this type with the full possible precision? 2) What happens if I use datetime2 in the "automatic" tracking fields (UpdatedOn and CreatedOn)? Thanks for the info! Dave Newman |
|
|
If you are using the 2008 or 2012 providers we will automatically use a DateTime2 as the parameter type when mapping a System.DateTime if the range is outside of the normal bounds for the traditional datetime data type. We use the default precision (7) when using this. We dont have any specific understanding of a datetime2 being the backing field as we translate both datetime and datetime2 to a System.DateTime and anything in the valid range will be mapped as if it is a datetime but there is an implicit conversion between a datetime and datetime2 at the SQL Server end so if you do have a datetime2 backing UpdatedOn or CreatedOn then the value will be handled just fine but the precision will be based on datetime as that will be the parameter type that is being used during command execution assuming the value are within the normal range. So as a general rule, you can always use datetime2 for storage, but its only going to be used by LightSpeed (and with the default precision of 7dp) when the value is outside the standard datetime range and in conjunction with the 2008 or 2012 providers.
|
|
|
Hi. I use SQLServer2008 provider and datetime2 for storage. LightSpeed insert in table rounded value, for example: '2015-03-12 14:56:49.0170000'. When the value is outside the standard datetime range, it isn't rounded: '1700-01-02 17:24:26.2189038'. How to insert the date in the standard datetime range without rounding? Thanks! |
|
|
What version of LightSpeed are you using? The current behaviour is as described above.
|
|
|
I use LightSpeed v.5.0.2849.0 Can i insert current datetime without rounding now? Thanks! |
|
|
Yes, the behaviour for that build should be as above.
|
|