Edit D:\SQL20160530-20170910\16.07.22.27_0002_PV_History_Guest_Add.sql
/* ???? pub_pvhistory ? PVType = 4 and PVTarget = 'Guest' ?????? ????? pub_pvhistory_guest ????????? ??? ????? Create by qjz at 2016-07-20 */ create procedure PV_History_Guest as begin begin transaction create table #historyguest(D datetime, c int) insert into #historyguest(D,C) select convert(varchar(10),CreateTime,23) as d, count(*) as c from pub_pvhistory where PVType = 4 and PVTarget = 'Guest' and convert(varchar(10),CreateTime,23) < convert(varchar(10),getdate(),23) group by convert(varchar(10),CreateTime,23) if @@error <> 0 goto err delete from pub_pvhistory where PVType = 4 and PVTarget = 'Guest' and convert(varchar(10),CreateTime,23) < convert(varchar(10),getdate(),23) if @@error <> 0 goto err delete #historyguest from #historyguest a, Pub_PVHistoryGuest b where a.D = b.D if @@error <> 0 goto err insert into Pub_PVHistoryGuest(D,C) select D,C from #historyguest if @@error <> 0 goto err drop table #historyguest commit transaction return 0 err: rollback transaction return -1 end
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de