Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 将INT(表示UNIX时间戳)转换为DBTIMESTAMP_Sql Server_Ssis - Fatal编程技术网

Sql server 将INT(表示UNIX时间戳)转换为DBTIMESTAMP

Sql server 将INT(表示UNIX时间戳)转换为DBTIMESTAMP,sql-server,ssis,Sql Server,Ssis,我想做一个数据流转换。我的源数据库包含一个带有UNIX时间戳的INT列(我知道这很糟糕,这是一个非常旧的系统,blablabla…;)。我想把这个INT-TIMESTAMP转换成我可以用于日期维度的东西,最好是DBTIMESTAMP 有没有办法做到这一点 在SQL中: select DATEADD(s,unixtimestamp,'1970-01-01') as sqldatetimestamp from mytable 在SSIS表达式中: DATEADD( "S", [unixtimes

我想做一个数据流转换。我的源数据库包含一个带有UNIX时间戳的INT列(我知道这很糟糕,这是一个非常旧的系统,blablabla…;)。我想把这个INT-TIMESTAMP转换成我可以用于日期维度的东西,最好是DBTIMESTAMP

有没有办法做到这一点

在SQL中:

select DATEADD(s,unixtimestamp,'1970-01-01') as sqldatetimestamp 
from mytable
在SSIS表达式中:

DATEADD( "S", [unixtimestamp] , (DT_DATE) "1970-01-01" )
当然,这是假设您拥有的unixtimestap确实是,它被定义为自1970年1月1日以来的秒数