Hi, I’ve been using Servoy successfully with Postgres but I now need to start using it with SQL Server 2008 instead. The problem is that any DATETIME field I create in MSSQL is seen as a TEXT field by Servoy. Even if I create a brand new table using Servoy with only one field on it, a DATETIME field, when I “Reload tables” in Servoy the field changes to a TEXT field. If I examine the table using SQL Server Management Studio it appears as a DATETIME field correctly before and after the reload. Can anyone point me in the right direction with this problem?
I’ve just updated to Servoy 6.0.4 build 1227 from an earlier build of 6 but the problem remains.
Thanks in advance…
That is a bug in the JTDS driver. Please try the Microsoft driver.
If you copy the jtds driver from 5.2 into the 6.0 directory, will the problem then be solved?
As I said, it is a bug inside the JTDS driver, which is not developed by Servoy. SQL Server 2008 introduces a new field type Datetime2 that is not properly mapped by the driver at this time. If you use SQL Server 2008 (R2?), you should use the Microsoft driver that you need to download yourself.
Thanks, I’ll give that a try. Any downside to using the Microsoft driver that I should be aware of?
Not that I know of. In general I’d say the JTDS driver is faster, so as soon as that is fixed, I’d change back.
I’ve switched to the Microsoft driver and everything is working fine. Is the defaulting to DATETIME2 an R2 change? I’ve noticed that if you create a new column using SQL Server Management as DATETIME then everything works fine but columns created using Servoy become DATETIME2. If this has been the case since the release of 2008 then it looks like the JTDS driver is quite out-of-date.
Other than SQL syntax differences between Postgres and Server 2008, is there anything else I need to consider when moving solutions between the two?
Thanks for the help…
I’m not sure this is a SQL Server 2008 problem.
I use SQL Server 2008 both for Servoy 5.2 and Servoy 6.0
When adding a DATETIME column in the database using Servoy 6.0 it creates a DATETIME2 column in the database.
When adding a DATETIME column in the database using Servoy 5.2 it creates a DATETIME column in the database.
Next I copied the jtds.jar file from 5.2 Driver directory into the Servoy 6.0 Driver directory and I did the same.
And again Servoy 6.0 created a DATETIME2 column in the database using the jtds driver from 5.2
So it is not the jtds driver that makes this situation.
I guess there is also some Servoy stuff that has some influence.
Otherwise I would have the same problem in my Servoy 5.2 environment. That uses the same database and the same driver.
The only difference is the Servoy version!
Martin,
The type used when creating a column is not depending on the driver, but on the db type and the (hibernate) dialect used.
Servoy upgraded its hibernate libs in release 6, in which the mapping for sqlserver2008 for timestamps was changed from ‘datetime’ to datetime2’.
Rob
This has just been fixed in Servoy 6.0.x and 6.1.
Regards,
Andrei