我想删除sql server 2000中表的所有行,但每当我想手动删除或查询时,它都会显示错误。在帮助选项卡中,它显示ODBC错误:< 0s>。 我的表包含一些'0'值,但其数据类型为String。这就是原因 错误。
代码是:
stat2=conn.createStatement();
stat2.executeUpdate("Delete * from pat.dbo.PHPL");
"Key column information is insufficient or incorrect. Too many rows were affected by update"
这是警告,点击帮助后会显示:ODBC error: <0s>. An ODBC error has been generated. You might have deleted a record that has a foreign key value related to it, or you might have violated a check constraint. For details, refer to your ODBC documentation.
答案 0 :(得分:2)
使用
Truncate Table PHPL
我认为您有重复的身份,请检查您是否允许此列重复。