Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/22.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 SQL Server Access迁移助手:日期数据类型_Sql Server_Ms Access_Etl - Fatal编程技术网

Sql server SQL Server Access迁移助手:日期数据类型

Sql server SQL Server Access迁移助手:日期数据类型,sql-server,ms-access,etl,Sql Server,Ms Access,Etl,我一直在使用SQL Server Migration Assistant for Access将Access数据库迁移到SQL Server。但是,我需要将access中的数据类型“Date”转换为SQL Server中的类型。在SSMA中查看数据类型映射选项时,我只有datetime、datetime2、datetime2(精度)和smalldatetime的选项。如何将“日期”映射到SQL Server中的目标类型日期?这是否得到支持?我真的不想为某些列存储时间(小时和秒),例如“离开日期”

我一直在使用SQL Server Migration Assistant for Access将Access数据库迁移到SQL Server。但是,我需要将access中的数据类型“Date”转换为SQL Server中的类型。在SSMA中查看数据类型映射选项时,我只有datetime、datetime2、datetime2(精度)和smalldatetime的选项。如何将“日期”映射到SQL Server中的目标类型日期?这是否得到支持?我真的不想为某些列存储时间(小时和秒),例如“离开日期”列

非常感谢


您所指的Access“Date”数据类型实际上是日期/时间,并且与SQL Server Datetime兼容,因此请使用该数据类型。如果数据始终在smalldatetime的有效日期范围内,也可以使用smalldatetime。如果要将Access转换为BE并保留Access FE,请小心不要使用Access无法识别的任何SQL Server数据类型。例如,datetime2,Date(SQL Server 2012确实有)。

我找到了这个。可能这个etl不支持SQL的日期数据类型。但是,如果您可以访问数据库,您总是可以稍后编写一个查询来将datetime转换为date。那么您是说要编写一个自定义查询来将列转换为date?是的,在ETL加载数据之后,在SQL Server中,您可以使表结构具有一个额外的计算列,该列为“日期”类型,并从datetime列中获取值。这肯定会奏效,但我不知道这是否是最好的方法,因为我以前从未这样做过。是的,使用DateTime。ODBC驱动程序将DateTime2转换为文本。