我建立了一個存儲過程:「存儲過程指定的參數太多」 的SQLServer
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.
我沒有正確指定這個過程可以帶兩個參數嗎?
輸入正確的日期格式並檢查 – Azar
您嘗試使用正確的存儲過程? sp_orders_by_dates'2003年1月1日','2003年6月30日' – JBrooks
謝謝J.是的,完全錯過了。 – 121c