SQL Server type "Time" is not present in Data Abstract?

Here’s another odd one.

The database that I’m working with has a column named “testTime” which is of type time(0). The SQL Server documentation for this type is below.

https://docs.microsoft.com/en-us/sql/t-sql/data-types/time-transact-sql

Data Abstract does not recognize this column and if I try to add it manually then writing values to this column fails. The local database is written out to an XML file and shows a value of ‘PT1M34S’ in the XML code. When I look at the column on the server it shows a time in the format ‘00:01:34’ which I’m guessing means it took 1 minute and 34 seconds to complete the test.

When I tried adding testTime to the Data Abstract schema as a DateTime column writing a record to the table triggers an exception stating that the date/time format was not valid.

Is there a simple option for handling this column?

I got around this by adding a string column on the server, passing the value as a string, and dealing with it on the SQL Server end.

Hello

Yes, unfortunately MS SQL Server data type time(0) is not supported by Data Abstract as is.
As a workaround you can use a simple integer or long integer fied to store exactly the same data (ie number of seconds) and convert that integer to the System.Timespan (the .NET representation of the time type) only for GUI purposes.

Regards

Unfortunately I was not able to do that because the database structure already exists.

However, adding a field of type DateTime to the schema and assigning the value from a DateTime variable in the .NET application seems to work.

I’ll log an issue to investigate if we can at least expose the time(0) fields as DataTime in the Schema.

Thanks, logged as bugs://78446

bugs://78446 got closed with status fixed.

As it turns there can be issues when reading this value back from the database. Anyway, the next Beta build should have support for time fields