我构建了一个存储过程:
CREATE PROCEDURE dbo.sp_orders_by_dates
@start_date datetime,
@end_date datetime
AS
SELECT
order_id,
orders.customer_id,
customers.name,
shippers.name,
shipped_date
FROM orders
INNER JOIN customers ON orders.customer_id = customers.customer_id
INNER JOIN shippers ON orders.shipper_id = shippers.shipper_id
WHERE shipped_date BETWEEN @start_date AND @end_date
当我使用以下方法执行该过程时:
EXECUTE sp_customer_city 'January 1, 2003', 'June 30, 2003'
我收到:
Msg 8144, Level 16, State 2, Procedure sp_customer_city, Line 0
Procedure or function sp_customer_city has too many arguments specified.
我是否没有正确指定该过程可以接受两个参数?
最佳答案
您正在调用与您显示的构建过程不同的存储过程。 sp_customer_city 定义的参数少于两个,这就是错误消息的含义。调用 sp_orders_by_dates 就可以了。
关于sql - "Stored Procedure has too many arguments specified"SQL服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24394123/