mysql - 如何调试导致 '"出现错误 "Incorrect syntax near ' 的 SQL 查询?

标签 mysql sql sql-server

alter table tbl_Donor
add constriant df_con1
default ((1)) for Active;

我收到错误消息:

Incorrect syntax near 'for'.

最佳答案

您拼写错误的约束。

在 SQL 服务器中:

alter table t add constraint df_con1 default 1 for Active;

关于mysql - 如何调试导致 '"出现错误 "Incorrect syntax near ' 的 SQL 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42926111/

相关文章:

MySQL删除内部连接但外键约束失败

c# - 在 C# 中使用数据表参数执行存储过程时出错

sql-server - SQL Server : replace sequence of same characters inside Text Field (TSQL only)

c# - 按参数列表过滤 SQL 查询

按类型排序的 MySQL 查询计数

php - 如何使用php和Mysqli从MySQL加载图像

MySQL:从记录集中选择具有表名的表

sql - 有限制的多对多关系的数据库设计

c# - 错误 : No mapping exists from object type

SQL:如何在每个字符处拆分字符串以显示在单独的行中?