ms-access - 在列中插入默认值( Access 数据库)

标签 ms-access alter

如何将默认值插入到 Access 表的列中? 我使用这条指令:

ALTER TABLE Tabella ADD Campo Double DEFAULT 0
ALTER TABLE Tabella ADD Campo Double DEFAULT (0)
ALTER TABLE Tabella ADD Campo DEFAULT 0
ALTER TABLE Tabella ADD Campo DEFAULT (0)
ALTER TABLE Tabella ADD Campo SET DEFAULT 0
ALTER TABLE Tabella ADD Campo SET DEFAULT (0)

但所有这些都会导致错误。我该怎么做?

最佳答案

来自 MSDN :

The DEFAULT statement can be executed only through the Access OLE DB provider and ADO. It will return an error message if used through the Access SQL View user interface.

Sooo...告诉我们更多关于您在做什么以及您如何执行 SQL 的信息?

为什么不使用表格设计器?

关于ms-access - 在列中插入默认值( Access 数据库),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/352991/

相关文章:

mysql 索引创建问题

Oracle 授予更改序列

sql - MS Access FE/SQL BE 保存后需要自动编号填充到表单上

ms-access - Access 用保留原始名称引用的 ODBC 链接表替换本地表

ms-access - Microsoft Access 2007 和 2010 : "Run-Time Error ' 42 9': ActiveX component can' t create object"

Excel 中的 SQL 查询给出 "undefined function name"错误

vb.net - 插入小数为 0.00000000

hadoop - HIVE 中 ALTER TABLE 命令中的 CONCATENATE 如何工作

MySQL 更改表数据库卡住

sql - 将列添加到架构中的多个表