Sql Server CE 4 插入默认值

发布于 2025-01-04 03:58:54 字数 263 浏览 4 评论 0原文

我使用 Sql Server CE 4 创建了下表。

create table abc(id int Identity(1,1) Primary key)

如果我尝试插入一行以使用以下命令生成新标识:

insert into abc default value

我收到一条错误消息,指出默认单词附近存在问题。

我如何使用 Sql Server CE 4 执行此操作还是不可能?

Using Sql Server CE 4 I have created the follow table.

create table abc(id int identity(1,1) primary key)

If I try and insert a row to generate a new identity using the following:

insert into abc default values

I get an error stating there is an issue near the default word.

How can I do this using Sql Server CE 4 or is it not possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

幽蝶幻影 2025-01-11 03:58:54
CREATE TABLE [abcd] (
  [id] int NOT NULL  IDENTITY (1,1) PRIMARY KEY
, [payload] bit NULL
);
GO
INSERT INTO abcd (payload) VALUES (0);
GO

或者自己评估 INT 值

CREATE TABLE [abcd] (
  [id] int NOT NULL  IDENTITY (1,1) PRIMARY KEY
, [payload] bit NULL
);
GO
INSERT INTO abcd (payload) VALUES (0);
GO

Or assing the INT value yourself

深海不蓝 2025-01-11 03:58:54

试试这个:

insert into abc (id) values (default)

Try this :

insert into abc (id) values (default)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文