when trying to preview an SAP Table in a Synapse integration Dataset i got the following error:
The "Timestamp" column contains an invalid value "10.04.2022 10:20:02". "10.04.2022 10:20:02" cannot be converted to DateTime type.
The string was not recognized as a valid DateTime.
is this a configuration in SHIR or where can i check?
Related
I'm working with PolyBase on SQL Server 2022. I have some tables with type "datetime NULL" on Sybase ASE 16.
When declaring an external table e.g.
CREATE EXTERNAL TABLE SYBASESCHEMA.SomeTable
(
[SomeNiceTime] DATETIME NULL
)
WITH (LOCATION = N'SomeNiceDatabase.dbo.SomeTable', DATA_SOURCE = SYBASE_DS);
I receive an error message like the following one:
105083;The following columns in the user defined schema are incompatible with the external table schema for table 'SomeTable': 'SomeNiceTime' failed to be reflected with the error: 'The detected ODBC SQL_TYPE 11 is not supported for external generic tables.'
Does anyone know how this could be resolved?
Im new to polybase. I have linked my SQL 2019 server to a third parties Azure cosmos and i am able to query data out of my collection. I am getting an error out when i try to query date fields though. In the documents the dates are defined as:
"created" : {
"$date" : 1579540834768
},
In my external table i have the column defined as
[created] DATE,
I have tried to create the column as int and nvarchar(128) but the schema detection rejects it each time. (i have tried to create a field created_date but the schema detection also disagree's that this is correct.
When i try a query that returns any of the date fields i get this error:
Msg 105082, Level 16, State 1, Line 8
105082;Generic ODBC error: [Microsoft][Support] (40460) Fractional data truncated while performing conversion. .
OLE DB provider "MSOLEDBSQL" for linked server "(null)" returned message "Unspecified error".
Msg 7421, Level 16, State 2, Line 8
Cannot fetch the rowset from OLE DB provider "MSOLEDBSQL" for linked server "(null)". .
This happens if i try and exclude null values in my query - even when filtering to specific records where the date is populated (validated using the Azure portal interface)
Is there something i should be doing to handle the integer date from the json records; or another type i can use to get my external table to work?
Found a solution. SQL Server recommends the wrong type for mongodb dates in the schema. Using DateTime2 resolved the issue. Found this on a polybase type mapping page in msdn.
I have a vendor oracle DB storing values to a column creation_timestamp as timestamp(6) when i create an extract of that table and load it to HDFS and create hive schema with that column defined as timestamp it does not populate the field. However if I use string it is all there. I have other MSSQL datetime data that successfully stored as timestamp in hive so I am just a little unsure why the oracle timestamp data is not populating.
The oracle timestmap looks like this: 07-JAN-15 05.55.20.732754000 PM
I have a feeling hive does not like the month as letters as the documentation states:Strings: JDBC compliant java.sql.Timestamp format "YYYY-MM-DD HH:MM:SS.fffffffff" (9 decimal place precision)
How can I convert the oracle timestamp(6):07-JAN-15 05.55.20.732754000 PM to the java.sql.Timestamp format shown above?
I was able to alter my session and then export the table, hive has now accepted it as a timestamp
ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF';
07-JAN-15 05.55.20.732754000 PM is now: 2015-01-07 17:55:20.732754000
Use to_date in hive.
Example :
select TO_DATE(from_unixtime(UNIX_TIMESTAMP('7-MAR-13', 'd-MMMM-yy'))) from table_name
Refer : date functions
In a Teradata(13.5) target table we have column with data-type Number; when we try to load this table using Informatica flow it gives following error:
[Severity Timestamp Node Thread Message Code Message
ERROR 4/1/2015 3:08:52 PM node01_<host_name> WRITER_1_*_1 WRT_8229 Database errors occurred:
FnName: Execute -- [Teradata][ODBC Teradata Driver] Illegal data conversion]
We have tried everything including:
1. Changing Informatica target datatype to decimal, bigint, integer, varchar
2. Importing target table to Informatica using Informatica Target Designer but this Number field is imported as Varchar(0)
Please suggest how to solve this as changing target data-type is not an option for us.
You can import target table to Informatica using Informatica Target Designer, and then edit the datatype for the column to anything you want. It can be alterered without issues.
I'm using MS SQL 2000, VS2008, MVC and C#.
I'm trying to insert and update some data using stored procedures.
Some columns are of type datetime.
Regional settings on both server and client are set to Dutch (Belgium)
This means the default date format is dd/mm/yyyy.
When i try to insert or update with a date of eg. 28/03/2009, I get following errors:
Insert:
Error converting data type nvarchar to datetime
Update:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value
When I try with a date like 01/03/2009, I get no errors but the date is saved as 03/01/2009, which is the US date format.
This is typical behaviour for problems with regional settings. But both are set to Dutch (Belgium).
Why does it save dates in the US format?
What am i missing here?
Thanks!
Stijn
You should be inserting data into the database using a DateTime object, not a string. Your client-side code should convert the client's date entry to a DateTime object using the client's regional settings, then the DateTime struct should be added to the parameter that is ultimately sent into the database.
The SQL Instance has it's own locale setting, by default "us_english"
Now, this usually happens if you pushing using varchar rather than native datetime to store data values. If your code/tables use datetime columns and you define parameters as datetime then you won't get errors.
i had this problem too, its something to do with the date format for you SQL server,
i solved it by formatting the date string to be inserted like so
DateTime.Now.ToString("MM/dd/yyyy HH:mm")
hope that helps
All above suggestions are correct but I find if you are adding a datetime as a string/varchar the safest way is in the format 'YYYY-MM-DD'
So eg.
Update MyTable
Set MyDate = '2010-03-01'