我正在使用IntelliJ进行开发。我成功连接到MSSQL服务器,并且我的所有表等都加载了。我可以看到所有的表格。我可以看到存储过程的名称和输入。
但是,当我尝试通过双击编辑存储过程时,我收到以下消息:
-- Definition loading failed:
-- java.sql.SQLException: The database name component of the object qualifier must be the name of the current database.
-- at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
-- at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
-- at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792)
-- at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
-- at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
-- at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
-- at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
-- at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
-- at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:616)
-- in RemoteStatementImpl.executeQuery(RemoteStatementImpl.java:141)
-- at com.sun.proxy.$Proxy100.executeQuery(Unknown Source)
-- in DbImplUtil.concatStringResults(DbImplUtil.java:428)
我在几个博客上读到没有本机支持,有人找到解决方法吗?
您应该能够在 Intellij IDEA 12 及更高版本中编辑存储过程:http://youtrack.jetbrains.com/issue/IDEA-84426。
这是相关的:我可以在IntelliJ IDEA中编辑MS SQL存储过程吗?
既然如此,也许这是您遇到的错误,值得在 http://youtrack.jetbrains.com/上提出它?
更新
我刚刚在Oracle 11.2.x中创建了一个简单的存储过程,并在Intellij IDEA 13中对其进行了编辑,没有任何问题。
尝试在 MSSQL 服务器中创建和编辑相同的内容?
CREATE OR REPLACE PROCEDURE procPrintHelloWorld
IS
BEGIN
--DBMS_OUTPUT.PUT_LINE('Hello World!');
PRINT N'Hello World!';
END;
/