example: -------------------------------------------------------------------------- --Create sp_test create procedure sp_test(@num int output) as begin select * from sysobjects select @num = count(*) from sysobjects end go--Call sp_test declare @i int exec sp_test @i output select @i go--Drop sp_test drop procedure sp_test go
我是用SET 付的字符串,可返回值为空.为什么?
declare @i varchar(20) set @i=''
我是这样写的 create procedure sp_test(@num varchar(1024) output) as begin select * from sysobjects set @num = 'wzf,zjs,djfls' end go记录集没问题,可字符串为空,为什么?
--------------------------------------------------------------------------
--Create sp_test
create procedure sp_test(@num int output)
as
begin
select * from sysobjects
select @num = count(*) from sysobjects
end
go--Call sp_test
declare @i int
exec sp_test @i output
select @i
go--Drop sp_test
drop procedure sp_test
go
set @i=''
create procedure sp_test(@num varchar(1024) output)
as
begin
select * from sysobjects
set @num = 'wzf,zjs,djfls'
end
go记录集没问题,可字符串为空,为什么?
exec sp_test @i output
select @i
go
create procedure sp_test(@num varchar(1024) output)
as
begin
select * from sysobjects
set @num = 'wzf,zjs,djfls'
end
return
go