Kattle Mysql与SQL Server之间导数的字段关系

因为数据库字段属性差异导致【将截断字符串或二进制数据。】,Mysql与SQL Server之间导数的字段关系需要参照下表进行设置:

Integer

MySQLMS SQL ServerConversion remarks
TINYINTtinyinttinyint is unsigned
SMALLINTsmallint-
MEDIUMINTintint stores data on 4 bytes
INT
BIGINTbigint-

Decimal

MySQLMS SQL ServerConversion remarks
DECIMAL(M,D)decimal(p,s)The maximum precision is 38, while the default is 18. The default scale is 0.

浮点或双精度数据类型用于精度大于38的小数。

Advertisement

Floating Point

MySQLMS SQL ServerConversion remarks
FLOAT(N)float(n)-
FLOAT(M,D)float(24)SQL Server does not allow the non-standard syntax
DOUBLE(M,D)float(53)SQL Server does not allow the non-standard syntax
REAL(M,D)

Date and Time

MySQLMS SQL ServerConversion remarks
DATETIMEdatetime2Date values start at 0001-01-01
DATEdateDate values start at 0001-01-01
TIMEtimetimerange is 00:00:00.0000000 through 23:59:59.9999999
TIMESTAMPsmalldatetimesmalldatetime value range is 1900-01-01 through 2079-06-06
YEARsmallint-


MS SQL Server不能将零存储为月份或日期。

String

MySQLMS SQL ServerConversion remarks
CHARnchar(n)nchar allows 4000 characters
VARCHARnvarchar(n|max)nvarchar allows 4000 characters but max indicates maximum storage size of 2^31-1 bytes.
TINYTEXT
TEXT(M)
MEDIUMTEXT
LONGTEXT


字符串常量中的\'转义序列应替换为双引号字符。

Binary

MySQLMS SQL ServerConversion remarks
BINARY(M)binary(n)binary allows 8000 bytes
VARBINARY(M)varbinary(n|max)nvarbinary allows 8000 bytes but max indicates maximum storage size of 2^31-1 bytes.
TINYBLOB
BLOB
MEDIUMBLOB
LONGBLOB

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值