Greg,
Why should I look at Oracle docs for MS SQL? Not sure I understand. Obviously, executing this will result in an error in MS SQL:
select {ts '2017-02-24 10:56:12.790000'}
Msg 241, Level 16, State 3, Line 1
Conversion failed when converting date and/or time from character string.
However this works:
select '2017-02-24 10:56:12.790'
There may be some valid considerations for using the former format, but the statements are generated from MS SQL database, therefore should run in MS SQL correctly whether in Squirrel or any other client. This is not happening - the former format only runs in Squirrel. If I generated a statement in Squirrel, I therefore cannot provide it to another person not using Squirrel, and I cannot save it to source control as no one will be able to apply it. The setting I mentioned should apply to generated timestamps as well.
Makes sense?
Thank you
Alex
-----Original Message-----
From: Gerd Wagner [mailto:ger...@t-...]
Sent: Monday, June 26, 2017 4:30 PM
To: Alex Malmyguine; squ...@li...
Subject: Re: [Squirrel-sql-users] Date/time format in the generated insert into script for SQL Server
Am 20.06.2017 um 17:08 schrieb Alex Malmyguine:
> When generating an INSERT-INTO script from the result of a select
> statement, the DATETIME column values come across as follows:
>
> {ts '2017-02-24 10:56:12.790000'}
>
> The correct format would be as follows:
>
> '2017-02-24 10:56:12.790'
No, it isn't. The upper form is correct. See section 13.4.2 of the JDBC specification here:
http://download.oracle.com/otndocs/jcp/jdbc-4_2-mrel2-eval-spec/index.html
>
> Also, BIT fields come across as 'true' or 'false' which confuses SQL
> Server when this executes. Can those be changed to 1/0?
This should be possible by the help of the MSSQL Plugin. Do you use the plugin. If not please try it out and see if it already works. If not you might want to file a feature request here:
https://sourceforge.net/p/squirrel-sql/feature-requests/?source=navbar
Gerd
|