create proc test(@blogid varchar(20),@date varchar(10))
as
select count(*) from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@date
select pl.ProClassName,pl.ProClassUrl,pl.ProTitle,pt.PlayID, pt.PlayName, pt.PlayTime, pt.Ispremiere, pt.duration ,pt.release, pt.prevue from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID
and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@date
as
select count(*) from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@date
select pl.ProClassName,pl.ProClassUrl,pl.ProTitle,pt.PlayID, pt.PlayName, pt.PlayTime, pt.Ispremiere, pt.duration ,pt.release, pt.prevue from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID
and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@date
as
declare @num int
select @num=count(*) from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@date
select pl.ProClassName,pl.ProClassUrl,pl.ProTitle,pt.PlayID, pt.PlayName, pt.PlayTime, pt.Ispremiere, pt.duration ,pt.release, pt.prevue into #temp from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID
and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@dateexec('select top '+ @num +' * from #temp')drop table #temp
as
declare @num int,@str varchar(1000)
select @num=count(*) from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@date
select pl.ProClassName,pl.ProClassUrl,pl.ProTitle,pt.PlayID, pt.PlayName, pt.PlayTime, pt.Ispremiere, pt.duration ,pt.release, pt.prevue into #temp from ProgramList as pl,PlayTime as pt where pt.ProID=pl.ProID
and pt.BlogID=@blogid and replace (CONVERT(char(10),pt.PlayTime,111),'-','/')=@dateset @str='select top '+ ltrim(@num) +' * from #temp'exec (@str)drop table #temp