Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - SQL 的用法 » 创建数据库 » 确保数据完整性 » 使用列缺省值

 

变更和删除列缺省值

可以使用 ALTER TABLE 语句更改或删除列缺省值,方式与用此语句创建缺省值时相同。以下语句将名为 OrderDate 的列的缺省值从其当前设置更改为 CURRENT DATE:

ALTER TABLE SalesOrders
ALTER OrderDate DEFAULT CURRENT DATE;

要删除列缺省值,可将其修改为 NULL。以下语句将删除 OrderDate 列中的缺省值:

ALTER TABLE SalesOrders
ALTER OrderDate DEFAULT NULL;