2013-02-05 75 views
1

可能重複:
Debugging Stored Procedure in SQL Server 2008調試存儲過程

我想調試SQL Server中的存儲過程。我嘗試了斷點,但這對我並不起作用。我甚至在流量上搜索,但沒有得到正確的答案。我的程序如下,

USE [Practice] 
GO 
SET ANSI_NULLS ON 
GO 
SET QUOTED_IDENTIFIER ON 
GO 

ALTER procedure [dbo].[selectsample] 
@input varchar(100), 
@output int output 
as 
begin 
select @output=id 
from people where [email protected] order by id desc 
end 

什麼是調試此存儲過程的最佳方法?

+0

我通常對這個大小的過程做的只是用不同的參數執行它幾次。 – flup

+2

http://stackoverflow.com/questions/14682112/how-can-execute-store-procedure-step-by-step-in-sql-server/14682143#14682143 – DON

+1

http://stackoverflow.com/questions/1793612/debugging-stored-procedure-in-sql-server-2008 – Serg

回答

0

嘗試在您的查詢中添加top 1。你有一個輸出patameter,但你的查詢可以返回多個值(如果有更多的人符合name = @輸入條件,那該怎麼辦)