加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Sqlite中的NVARCHAR(MAX)

发布时间:2020-12-12 18:56:40 所属栏目:百科 来源:网络整理
导读:我在Sqlite中创建一个表,其中包含一个最大长度的列: create table [Log] ( Id int identity not null constraint PK_Log_Id primary key,Data nvarchar (max) null) 但以下行未被接受: Data nvarchar (max) null 为什么? 解决方法 max特定于SQL Server(我
我在Sqlite中创建一个表,其中包含一个最大长度的列:

create table [Log] (
    Id int identity not null
        constraint PK_Log_Id primary key,Data nvarchar (max) null
)

但以下行未被接受:

Data nvarchar (max) null

为什么?

解决方法

max特定于SQL Server(我认为是Sybase).只需使用文字:

data text not null

或者,您可以使用任何字符串数据类型. SQLite不强制实施长度限制:

Note that numeric arguments in parentheses that following the type
name (ex: “VARCHAR(255)”) are ignored by SQLite – SQLite does not
impose any length restrictions (other than the large global
SQLITE_MAX_LENGTH limit) on the length of strings,BLOBs or numeric
values.

(见here).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读