日期:2014-05-18  浏览次数:20369 次

select * from authors where au_id is not null 存储过程如何写?
select * from authors where au_id is not null and au_lname is not null and au_Phone is not null and city =传进来的条件
如果au_id au_lname au_Phone 用户输入而改变怎么写?

------解决方案--------------------

SQL code
CREATE proc Authors
@au_id int(4),
@au_lname varchar(10),
@au_Phone varchar(20)
as
declare @sql varchar(8000)
select * from authors where @au_id  is  not null and @au_lname is not null and @au_Phone is not null and  city
exec(@sql)
GO

------解决方案--------------------
mark