rails - activerecord-sqlserver-adapter - sql server not recognizing dates - sql-server

Rails 3.2.1
I'm using SQL Server 2008 with the sqlserver rails plugin (rails-sqlserver/activerecord-sqlserver-adapter # github)
When I save records they fail because TinyTDS can't parse the date (2006-09-13 10:00:00 -0400, created_at, updated_at) (I think mssql needs the offset in the format of -hh:mm).
I get a similar result when I run the query directly in sql server. It works in sql server if I make the data type 'datetimeoffset' but I have almost 100 tables and... well I don't really want to make that manual change to all of those tables.
How can I get rails to migrate the tables with the proper date format and get it to write dates in a format that mssql will accept?

Related

Oracle to SQL server Migration Date Format changes

I Used SELECT TO_CHAR(sysDate,'dy') FROM DUAL In oracle and I want to get the same output in SQL Server. I tried several ways and I want to know the date style value for this format.
CONVERT(VARCHAR(max),'2017-03-06T00:00:00.000',<DateStyle>)

SSAS OLAP Cube Output Date Format mm/dd/yy to yyyy-MM-dd

I have deployed an SQL Server 2012 on a Windows Server en-us.
Now my dates on Analysis services are in this format MM/dd/yyyy. the company is not American, therefore I would like to change it to yyyy-MM-dd.
Everything seems to be properly configured, however, SSAS is refusing to output the dates in the desired format.
Query on SQL Database engine
Windows Server Regional Settings
an easy and fast way is to create a computed column on DimDate in SSMS, and specify this a name value for your datekey. Let me if that works.
ALTER TABLE [Dim].[Date] ADD AlternateDateFormat AS convert(date,[FullDate], 111);

SQL server to postgres migration : timestamp conversion issue

I have a data dump of a table from a SQL server, and I would like to import it into Postgres database. The generated file contains dates like this:
CAST(0x00009A78007FD81B AS DateTime)
This is limiting me from doing manual modifications to the SQL! Apparently that is the only column that is holding this simple migration process!
Other answers on the web don't show a work around! Here are the links I came across
SqlServer to Postgres DDL migration/conversion
http://www.postgresonline.com/journal/archives/46-Setting-up-PostgreSQL-as-a-Linked-Server-in-Microsoft-SQL-Server-64-bit.html
https://wiki.postgresql.org/wiki/Microsoft_SQL_Server_to_PostgreSQL_Migration_by_Ian_Harding

How to change the date format on SSAS 2012

I have deployed an SQL Server 2012 on a Windows Server en-us.
Now my dates on Analysis services are in the American format (MM/dd/yyyy). the company is not American, therefore I would like to change it to yyyy-MM-dd or dd-MM-yyyy, how can i do it?
Everything seems to be properly configured, however, SSAS is refusing to output the dates in the desired format :(
On excel:
On cube browsing:
On dimension browsing:
Dimension seems to be properly configured on SSAS:
Query on SQL Database engine:
SSAS properties
SQL Server Database engine properties
Windows server regional settings
A few month ago i was enduring the same problem with the date, i thought the issue was comming from SSAS but i was wrong...
So i totally changed my dimension table with a new table containing all date format, so now i can use any format that i want...
You can find how to create it in this link:
http://www.codeproject.com/Articles/647950/Create-and-Populate-Date-Dimension-for-Data-Wareho
I did have similar problem - checked all 3 environment DEV/UAT/PROD - no difference at all - however, DEV and UAT giving the Date in correct format (yyyy-mm-dd)- but PROD was in US format - tried everything, but still PROD showing in US format. Next, I reprocessed and deployed the cube from Visual Studio. Once it is completed i.e deployed to PROD - Date was in correct format - ie in yyyy-mm-dd.

SQL Server JBDC DATE gets wrong metadata result type

I have a strange problem:
When i create a column in SQL Server 2008, JDBC Driver 2.0, sqljdbc4.jar with Java 1.6
create table ctypes (dbms_date DATE NOT NULL, dbms_date_null DATE)
The data type in the database is correctly date
But when I access the table with JDBC select
The metadata says that the type is nvarchar, still the getDate() function is working.
The problem is that I am programming a framework that generically copies data and must rely on the data type.
I am not a big SQL Server specialist, so maybe it some configuration in the SQL Server server that is responsible, I left as much to the default values as possible.
The problem is fixed by downloading Driver 3.0

Resources