create procedure sp_name @keyword nvarchar(50)
as Declare @keycount int select @keycount=COUNT(0) from 关键字表 where 关键字=@keyword
if(@keycount>0) return else select * from 地区表 where 地区=@keyword go
--执行存储过程 Exec sp_name '123'
ALTER PROCEDURE [dbo].[P_test]
-- Add the parameters for the stored procedure here
-- Add the parameters for the stored procedure here
@C_Conditon varchar(50)
AS
BEGIN
if(exists(select * from Table where C_Order=@C_Conditon))
return;
else
select * from Table ;
-- Insert statements for procedure here
END
楼上的回复都很好。。