我的世界小本吸血鬼14:slqserver中给表增加一个字段的语句怎么写
来源:百度文库 编辑:高校问答 时间:2024/10/02 17:33:46
我的语句是:alter table test add isactive smallint(6) not null default 0;
返回的错误是:
com.microsoft.jdbc.sqlserver.SQLServerConnection@12b6651
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]? 7 ?????: ??????? int ??????
加了 WITH VALUES后仍然返回错误!!
我的程序如下
String sql_s1 = "alter table test add isactive smallint(6) not null default 0 WITH VALUES;";
int iBack=stmt_s.executeUpdate(sql_s1);
System.out.println("isactive:"+iBack);
com.microsoft.jdbc.sqlserver.SQLServerConnection@12b6651
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]? 7 ?????: ??????? smallint ??????
返回的错误是:
com.microsoft.jdbc.sqlserver.SQLServerConnection@12b6651
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]? 7 ?????: ??????? int ??????
加了 WITH VALUES后仍然返回错误!!
我的程序如下
String sql_s1 = "alter table test add isactive smallint(6) not null default 0 WITH VALUES;";
int iBack=stmt_s.executeUpdate(sql_s1);
System.out.println("isactive:"+iBack);
com.microsoft.jdbc.sqlserver.SQLServerConnection@12b6651
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]? 7 ?????: ??????? smallint ??????
不能给smallint类型指定长度,改成下面这样就行了,在查询分析器里测试通过。
alter table table3
add isactive smallint not null
default 0 WITH VALUES
alter table test
add isactive smallint(6) not null
default 0 WITH VALUES
语句好像不能直接用SQL语句实现,我只是在查询分析器里边测试的
slqserver中给表增加一个字段的语句怎么写
SQL server2000中,怎么样使得在查询结果中增加一个字段,该字段显示查询结果的行号
SQL server2000中怎么样使得在查询结果中增加一个字段,该字段显示查询结果的行号
在数据库中如何将一个表的字段做为变量给数组赋值,用VB
在数据库中如何将一个表的字段做为变量给数组赋值,用VB
在数据库中如何将一个表的字段做为变量给数组赋值,用VB
vfp中如何设置某一字段的值自动增加
如何解开access记录锁定,想对其中一个表的字段增加?
如何获取一个数据表中某个字段的数据到另一个数据库中某个表的字段?
在 sql server 2000 中如何增加一个 int 字段,not null, deault=0