CREATE PROC P_TEST@Name VARCHAR(20), @Rowcount INT OUTPUT AS BEGIN SELECT * FROM T_Customer WHERE NAME=@Name SET @Rowcount=@@ROWCOUNT END GO ---------------------------------------------------------------------------------------- --存储过程调用如下: ---------------------------------------------------------------------------------------- DECLARE @i INT EXEC P_TEST 'A',@i OUTPUT SELECT @i --结果 /* Name Address Tel ---------- ---------- -------------------- A Address Telphone