如何在SQL Developer中执行SQL Server存储过程? [英] How to Execute SQL Server Stored Procedure in SQL Developer?

查看:234
本文介绍了如何在SQL Developer中执行SQL Server存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已为我提供了一个SQL Server数据库用户帐户,该数据库仅具有执行存储过程的特权.我将JTDS SQL Server JDBC jar文件添加到SQL Developer,并将其添加为第三方JDBC驱动程序.我可以成功登录到SQL Server数据库.系统为我提供了运行该过程的语法:

I've been given a user account to a SQL Server database that only has privileges to execute a stored procedure. I added the JTDS SQL Server JDBC jar file to SQL Developer and added it as a Third Party JDBC driver. I can successfully log in to the SQL Server database. I was given this syntax for running the procedure:

EXEC proc_name 'paramValue1' 'paramValue2'

当我将其作为语句或脚本运行时,会出现此错误:

When I run this as either a statement or a script, I get this error:

Error starting at line 1 in command:
EXEC proc_name 'paramValue1' 'paramValue2'
Error report:
Incorrect syntax near the keyword 'BEGIN'.

我尝试将语句包装在BEGIN/END中,但得到相同的错误.是否可以从SQL Developer调用该过程?如果是这样,我需要使用什么语法?

I tried wrapping the statement in BEGIN/END, but get the same error. Is it possible to call the procedure from SQL Developer? If so, what syntax do I need to use?

推荐答案

您不需要EXEC子句.只需使用

You don't need EXEC clause. Simply use

proc_name paramValue1, paramValue2

(而且您需要使用Misnomer提到的逗号)

(and you need commas as Misnomer mentioned)

这篇关于如何在SQL Developer中执行SQL Server存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆