简体   繁体   中英

how can I edit MS SQL Server stored procedure from IntelliJ IDEA 12?

I am using IntelliJ for development. I connect to MSSQL Server successfully, and all my tables, etc load up. I can see all the tables. I can see the name and inputs of stored procedures.

However, when I attempt to edit the stored procedure by double-clicking, I get the following message:

-- 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)

I read on a few blogs that there's no native support, has anyone found a workaround?

You should be able to edit stored procedures in Intellij IDEA 12 and above : http://youtrack.jetbrains.com/issue/IDEA-84426 .

This is relevant: Can I edit MS SQL stored procedures in IntelliJ IDEA?

That being the case, perhaps this is a bug that you've encountered and it's worth raising it on http://youtrack.jetbrains.com/ ?

Update

I just created a simple Stored Procedure in Oracle 11.2.x and edited it in Intellij IDEA 13 without any issues.

Try creating and editing the same in MSSQL Server ?

CREATE OR REPLACE PROCEDURE procPrintHelloWorld
IS
BEGIN     
  --DBMS_OUTPUT.PUT_LINE('Hello World!');
  PRINT N'Hello World!';     
END;
/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM