re: 开张了 gm 2005-04-12 12:59
declare @sql varchar(8000)
set @sql='select '''' as 数据表,1 as 记录数 where 1=2 '
select top 60 @sql=@sql+'union select '''+name+''',count(1) from '+name+' go ' from sysobjects where xtype='U'
execute(@sql)
re: 开张了 gm 2005-04-12 12:53
declare @table varchar(32)
select 'abcdefghijklmnopqrstuvwxyz0123456789' as 数据表,999999 as 记录数 into #temptable where 1=2
declare mycursor cursor for select name from sysobjects where xtype='U'
open mycursor
fetch next from mycursor into @table
while @@fetch_status=0
begin
execute('insert into #temptable select '''+@table+''',count(1) from '+@table)
fetch next from mycursor into @table
end
close mycursor
deallocate mycursor
execute('insert into #temptable select ''统计时间:''+convert(varchar(19),getDate(),120),sum(记录数) from #temptable')
select * from #temptable
drop table #temptable
re: JS类中event的简单实现(续) birdshome 2005-04-08 14:40
其实一个EventHandler的scope中要是有32个事件函数,已经复杂的不行了:}
re: JS类中event的简单实现(续) Lonsan 2005-04-08 14:34
确实是存放数量有限,这个问题暂时没解决,如果有其他想法请提供
互相交流嘛,造个氛围,看着大家都踊跃,我也贡献点:)
re: JS类中event的简单实现(续) Laser.NET 2005-04-08 14:26
确实有创意啊!!赞!
不过我倒是有个限制:由于Javascript中的numeric value是用8字节的IEEE浮点数格式存放的,所以,我觉得一个EventHandler最多就能放8*8=64个function了。
re: JS类中event的简单实现 Lonsan 2005-04-08 10:43
已修改可以支持-=和+=操作,代码下午可以发上来,请大家多提意见,感谢各位朋友指点。
re: JS类中event的简单实现 Lonsan 2005-04-08 08:48
fro birdshome:你的想法好象是可行的,可以考虑一下。
re: JS类中event的简单实现 Lonsan 2005-04-08 08:43
:)
这只是偶然想到要这么来做的,昨天有点时间就实现了,只是一点个人想法。平时也很喜欢研究js,取个乐,呵呵
-=好象不好实现,或者说暂时没想到:(
re: JS类中event的简单实现 birdshome 2005-04-08 01:07
其实我也想过模拟+=和-=,除非用int来保存。
做一个表,int有32位,一bit位对应一个事件,就可以用+=和-=操作了,不过想起来都恐怖,我也就根本没有去试验:P
在我的TreeView控件中,也实现了一种事件模型,类似dom提供的attachEvent,明天要是有空就post出来。