create proc 过程名 as
select id,style_no,smallimg,ClassID,isnew,newtime,Img_Name from products where (Style_No like '%"&key&"%' or Content like '%"&key&"%')
最好转成函数:
create proc 函数() returns table as
return(select id,style_no,smallimg,ClassID,isnew,newtime,Img_Name from products where (Style_No like '%"&key&"%' or Content like '%"&key&"%'))
select id,style_no,smallimg,ClassID,isnew,newtime,Img_Name from products where (Style_No like '%"&key&"%' or Content like '%"&key&"%')
最好转成函数:
create proc 函数() returns table as
return(select id,style_no,smallimg,ClassID,isnew,newtime,Img_Name from products where (Style_No like '%"&key&"%' or Content like '%"&key&"%'))
return(select id,style_no,smallimg,ClassID,isnew,newtime,Img_Name from products where (Style_No like '%"&key&"%' or Content like '%"&key&"%'))
select id,style_no,smallimg,ClassID,isnew,newtime,Img_Name from products where (Style_No like '%"&key&"%' or Content like '%"&key&"%')
@key varchar(100)
as
select id,style_no,smallimg,ClassID,isnew,newtime,Img_Name from products where Style_No like '%'+@key+'%' or Content like '%'+@key+'%'