源程序:
ALTER proc GetDataByNumCategory
(
@Carcategory nvarchar()
)
as
declare @sql nvarchar()
declare @Num nvarchar()
set @Num=(select top Keyword from TaoCarActive)
declare @Green nvarchar()
declare @Green nvarchar()
set @Green=<span style="color:Green;">
set @Green=</span>
declare @Red nvarchar()
set @Red=<span style="color:Red;">
declare @Red nvarchar()
set @Red=</span>
exec(select top +@Num+
ID
case when Hits= then +@Green++CarCard++@Green+
else +@Red++CarCard++@Red+ end as CarCard
from
TaoCarActive where Carcategory=+@Carcategory+ order by ID)