在Copy表管道中将数据类型从timestamp转换为bigint [英] Convert data type from timestamp to bigint in the Copy table pipeline
问题描述
我有带有时间戳格式的表列的SQL Server数据源。
I have SQL Server data source with table column with timestamp format.
我有Azure SQL DW目标,它不支持时间戳。所以用bigint创建了列。
I have Azure SQL DW destination, which do not support timestamp. So was created column with bigint.
如何在复制表管道中从timestamp转换为bigint?
How to do transformation from timestamp to bigint during copy table pipeline?
Kenny_I
推荐答案
根据此链接。
https://docs.microsoft.com/en-us/sql/t-sql/data-types/rowversion-transact-sql?view=sql-server-2017
A nonnullable rowversion column
在语义上等同于 binary(8) 列。
可以为空的 rowversion 列
在语义上等同于 varbinary(8) column。
A nonnullable rowversion column is semantically equivalent to a binary(8) column. A nullable rowversion column is semantically equivalent to a varbinary(8) column.
这是我试过的,我把sink列类型作为二进制(8)和source(SQL Server)作为时间戳,它对我有效。
This is what I tried , I had the sink column type as binary(8) and the source ( SQL Server ) as timestamp and it worked for me .
接收器:
创建表Testtimesatamp_sink
(
id int identity(1,1),
name varchar(100),
timestampcolumn binary( 8)
$
)
create table Testtimesatamp_sink
(
id int identity(1,1) ,
name varchar(100) ,
timestampcolumn binary(8)
)
来源:
我还尝试使用&time:timestampcolumn varbinary(8)它工作得很好。
I also tried with timestampcolumn varbinary(8) and it just worked fine .
请告诉我它是怎么回事。
Please do let me know how it goes .
这篇关于在Copy表管道中将数据类型从timestamp转换为bigint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!