存储过程简单问题,关于存储过程内部调用返回值
CREATE PROCEDURE usp_InsertorUpdateSiteDetail
@set_it varchar(50
AS
declare @strTmp varchar(255)
set nocount on
set @strTmp = 'select count(*) as num from tbl_site_detail where set_it = ' ' '+@set_it+ ' ' ' '
GO
我想根据上述SQL语句中的纪录数作为条件
如何返回count(*)的值给一个变量呢,谢谢
------解决方案--------------------CREATE PROCEDURE usp_InsertorUpdateSiteDetail
@set_it varchar(50)
AS
declare @strTmp varchar(255)
declare @num int
set nocount on
select @num=count(*) from tbl_site_detailwhere set_it = @set_it
select @num
GO