USE [ykbz]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[helloo]
@num int=0 output
AS
if(1=1)
begin
while(@num<10)
begin
set @num=@num+1
print @num
end
end
declare @num1 int
exec helloo @num1 OUTPUT
因为要测试另外一个存储过程,我就写了这个简单点的存储过程,调试时却不执行,不知道为什么
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[helloo]
@num int=0 output
AS
if(1=1)
begin
while(@num<10)
begin
set @num=@num+1
print @num
end
end
declare @num1 int
exec helloo @num1 OUTPUT
因为要测试另外一个存储过程,我就写了这个简单点的存储过程,调试时却不执行,不知道为什么
解决方案 »
- 关于动态Case When的写法
- .net远程连接SQL server的问题~ 急~ 在线等~
- 这个sql怎么写
- sql server 2005 和 sql server 2000 能不能同时安装?
- SQL2000存储过程问题,请高人来回答一下,急!!!在线等
- SQL pro
- 大家好,初次到来,有个问题请教大家: exec ( 'Use Web_Shoes_03 SELECT TOP 1 ShopID FROM Shop ORDER BY ShopID ') 在这个语句中怎么
- 有谁知道装有SQL SERVER的机器改名后会出现什么情况?
- 关于AppModeler for PowerBuilder使用的问题
- 我在一个小城市看到这样一个管理信息系统
- 标量函数验证真假
- CreateDate字默唯一问题
@num int output
AS
SET @num=0
if(1=1)
begin
while(@num <10)
begin
set @num=@num+1
print @num
end
end
godeclare @num1 int
exec helloo @num1 OUTPUT
SELECT @NUM1DROP PROC HELLOO
...
set @num=0
if(1=1)
...
@num int,@num1 int=0 output
AS
begin
while(@num <10)
begin
set @num=@num+1
end
select @num1 = @num
end declare @num1 int
exec helloo 8,@num1 OUTPUT
select @num1
ALTER PROCEDURE [dbo].[helloo]
@num INT OUTPUT,@b INT= 20
AS
SET @num=0
IF (1 = 1)
BEGIN
WHILE (@num < 10)
BEGIN
SET @num = @num + 1
PRINT @num
END
END
SET @num=@num+@b
go
DECLARE @s INT
DECLARE @num1 INT EXEC helloo @num1 OUTPUT
SELECT @num1
--result
/*
30
*/EXEC helloo @num1 OUTPUT,@s
SELECT @num1
/*
null
*/
Alter PROCEDURE [dbo].[helloo]
@num int=0 output
AS
SET @num=ISNULL(@num,0)
if(1=1)
begin
while(@num <10)
begin
set @num=@num+1
print @num
end
end
GOdeclare @num1 int
exec helloo @num1 OUTPUT --the result--
1
2
3
4
5
6
7
8
9
10