SQL Server:存储过程什么都不返回

时间:2015-08-23 11:18:58

标签: sql-server

有表格Products

enter image description here

我创建了一个存储过程:

enter image description here

然后我尝试执行它

enter image description here

但我什么都没得到

enter image description here

enter image description here

有什么问题以及如何解决?

1 个答案:

答案 0 :(得分:3)

您需要更改SELECT语句。现在你要回来了,你传给SP的是什么。

 // Incorrect, you just pass it as SP arguments
 SELECT @id, @name, @price, @categoryID
 FROM Products
 WHERE name = @name;


 // Actual data, retrieved from table
 SELECT id, name, price, categoryID
 FROM Products
 WHERE name = @name;
相关问题