1、普通調試
直接點擊SSMS客戶端上的調試按鈕即可
2、存儲過程調試
2.1 定義存儲過程(以Northwind數據庫為例)
USE [Northwind] GO /****** Object: StoredProcedure [dbo].[sp_getOrders] Script Date: 2014/7/7 17:32:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[sp_getOrders] @orderID int = null as if (@orderID is null ) begin print 'null' end else begin print 'correct' end select * from Orders where OrderID = @orderID
2.2 調試存儲過程(直接點擊SSMS上的調試按鈕)
declare @i int ,@j int,@k int set @i = 1; set @j = 2; select @k=@i + @j exec sp_getOrders 10248 --調用存儲過程,自動進入斷點 select @i; go
