我在SQL Server 2000中尝试了以下查询,以便我可以在提到的列之后添加新列.
alter table abc ADD dad varchar(50) after parentname
Run Code Online (Sandbox Code Playgroud)
但它会抛出以下错误消息
消息170,级别15,状态1,行1
第1行:'之后'附近的语法不正确.
有没有办法在SQL Server 2000中执行此操作?
我正在尝试迭代ResultSet值以在while循环中插入查询。代码片段如下:
String sel="select roll_no from Nursery";
rs=stmt.executeQuery(sel);
stmt1=con.createStatement();
int aa;
while(rs.next())
{
aa=rs.getInt(1);
stmt1.executeUpdate("insert into [Nursery_FirstTerminal_marks](roll_no)values("+aa+")");
//stmt.close();
}
JOptionPane.showMessageDialog(null, "Data has been inserted");
}
catch(Exception e)
{
System.out.println(e);
// JOptionPane.showMessageDialog(null, e);
}
Run Code Online (Sandbox Code Playgroud)
但抛出以下给定的错误。
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
Run Code Online (Sandbox Code Playgroud)
你能建议如何摆脱它吗..