简体   繁体   English

Informatica Datetime转换为SQL Server Timstamp

[英]informatica Datetime conversion to SQL server Timstamp

I have a requirement where I have to load Informatica SESSSTARTTIME(datetime) to SQL server timestamp. 我有一个必须将Informatica SESSSTARTTIME(datetime)加载到SQL Server时间戳的要求。 When I am trying to connect datetime to timestamp I am getting error incompatible data type. 当我尝试将datetime连接到时间戳时,出现错误不兼容的数据类型。

Any suggestions how this can be achieved? 有什么建议可以实现吗?

Thanks 谢谢

in the mapping try to create output port in expression as sessionstarttime (which is a inbuilt variable) and pass it to target hope this will help to get desire output 在映射中尝试在表达式中创建作为sessionstarttime的输出端口(这是一个内置变量),并将其传递给目标希望这将有助于获得期望的输出

in session there is config tab where you can change the format for date and time 在会话中,有“配置”选项卡,您可以在其中更改日期和时间的格式

I had a similar issue in the past, where the date column was not getting loaded because of the difference in precision of date/time used by Informatica and SQL server. 过去,我遇到过类似的问题,由于Informatica和SQL Server使用的日期/时间精度不同,因此无法加载date列。 You can try this workaround: Change the data type in the target definition (not in SQL Server table, only in Informatica Target definition) to String, then Informatica will pass the date/time value in quotes when firing the insert query, which SQL server can convert to date/time automatically. 您可以尝试以下解决方法:将目标定义(不在SQL Server表中,仅在Informatica目标定义中)中的数据类型更改为String,然后在触发插入查询时,Informatica将在引号中传递日期/时间值,即哪个SQL Server可以自动转换为日期/时间。

MS SQL Server timestamp datatype has nothing to do with time. MS SQL Server 时间戳数据类型与时间无关。 It's an autogenerated number and you cannot load it. 这是一个自动生成的号码,您无法加载它。

https://msdn.microsoft.com/en-us/library/ms182776(v=SQL.90).aspx https://msdn.microsoft.com/en-us/library/ms182776(v=SQL.90).aspx

quote: 引用:

"Is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows. The storage size is 8 bytes. The timestamp data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime data type." “是一种在数据库中公开自动生成的唯一二进制数的数据类型。时间戳通常用作对表行进行版本标记的机制。存储大小为8字节。时间戳数据类型只是一个递增的数字,而不是保留日期或时间。要记录日期或时间,请使用datetime数据类型。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM