简体   繁体   English

用于访问的SQL Server迁移助手:日期数据类型

[英]SQL Server Migration Assistant for Access: Date data type

I have been using SQL Server Migration Assistant for Access to migrate an access database to SQL Server. 我一直使用Access的SQL Server迁移助手将Access数据库迁移到SQL Server。 However, I need to convert data type "Date" in access to the type Date in SQL Server. 但是,在访问SQL Server中的日期类型时,我需要转换数据类型“日期”。 When looking at the data type mappings options in SSMA I only have the options for datetime, datetime2, datetime2(precision) and smalldatetime. 当查看SSMA中的数据类型映射选项时,我只有datetime,datetime2,datetime2(precision)和smalldatetime的选项。 How do I get "date" mapped to the target type date in SQL Sever? 如何在SQL Sever中将“日期”映射到目标类型日期? Is this supported at all? 完全支持吗? I really don't want the time (hours and seconds) to be stored for some columns such as for the columns such as "leaving date". 我真的不希望为某些列(例如“离开日期”)存储时间(小时和秒)。

Many thanks. 非常感谢。

SQL Server迁移助手中的类型映射

What you are referring to as Access' 'Date' data type is actually Date/Time and is compatible with SQL Server Datetime, so use that. 您所谓的Access的“日期”数据类型实际上是日期/时间,并且与SQL Server日期时间兼容,因此请使用它。 You could also use smalldatetime, if your data will always be within the valid date range for smalldatetime. 如果您的数据将始终在smalldatetime的有效日期范围内,则也可以使用smalldatetime。 If you are converting your Access BE and retaining an Access FE, be careful not to use any SQL Server data types that Access will not recognize. 如果要转换Access BE并保留Access FE,请注意不要使用Access无法识别的任何SQL Server数据类型。 EG datetime2, Date (which SQL Server 2012 does have). EG datetime2,日期(SQL Server 2012确实具有)。

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

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