日期:2014-05-17 浏览次数:20928 次
CREATE PROC SF_OP3_set_color s_text NVARCHAR(100),@C_result NVARCHAR(1) OUTPUT
AS
BEGIN
if (select top 1 id from tab where @s_text)>0
set @C_result='1' else @C_result='0'
END
CREATE PROC SF_OP3_set_color
@s_text NVARCHAR(100),
@C_result NVARCHAR(1) OUTPUT
AS
BEGIN
exec('select top 1 id from tab where '+@s_text)
SET @C_result=SIGN(@@ROWCOUNT)
END
CREATE PROC SF_OP3_set_color
@s_text NVARCHAR(100),@C_result NVARCHAR(1) OUTPUT
AS
BEGIN
declare @sql nvarchar(1000),@id int
set @sql='select @id=count(id) from tab where '+@s_text
exec sp_executesql @sql,N'@id int out',@id out
if @id>0 set @C_result='1'
else set @C_result='0'
END