create table test(id int,name varchar(10))
insert into test select 1,'AAAA'
insert into test select 2,'BBBB'
gocreate procedure sp_test1(@count int output)
as
select @count=count(*) from test
gocreate procedure sp_test2
as
begin
declare @count int
exec sp_test1 @count output
select @count
end
goexec sp_test2
go--输出结果
/*
2
*/drop procedure sp_test2,sp_test1
drop table test
go
insert into test select 1,'AAAA'
insert into test select 2,'BBBB'
gocreate procedure sp_test1(@count int output)
as
select @count=count(*) from test
gocreate procedure sp_test2
as
begin
declare @count int
exec sp_test1 @count output
select @count
end
goexec sp_test2
go--输出结果
/*
2
*/drop procedure sp_test2,sp_test1
drop table test
go
解决方案 »
- 从sqlserver2000转到sqlserver2005问题
- 帮忙看看为什么有错,谢谢!
- 大家好,我用的是用友U890,想通过存货编码更新所有存货名称,请问在数据库中如何实现,具体操作,谢谢!!
- 请问如果update一个varchar类型的字段让他自增?我写成update Tab set varCom = varCom + 'later' where......但是不起作用
- sql请教
- 复制字段
- 触发器的问题
- ★★★★★怎样获取表中第i行到第j行的数据??
- 存储过程中用DELETE FROM很慢吗?好奇怪啊!!
- SQL Server 2000 + IIS V5.1 + ASP.NET 2.0老系统迁移
- 如何实现Power 函数的逆运算
- 请教一个联查,求和的SQL语句,对我来说难,别别人来说可能很简单
as
begin
exec jj --jj为存储过程名
end
as
begin
exec yyjj @K,@W --yyjj为存储过程名,后面为参数。
end
insert into test select 1,'AAAA'
insert into test select 2,'BBBB'
gocreate procedure sp_test1(@count int output)
as
select @count=count(*) from test
gocreate procedure sp_test2
as
begin
declare @count int
exec sp_test1 @count output
select @count
end
goexec sp_test2
go--输出结果
/*
2
*/drop procedure sp_test2,sp_test1
drop table test
go
panjinfu80(天蓝水晶) ( )
create proc jjyy
as
begin
exec yyjj @K,@W --yyjj为存储过程名,后面为参数。
end