select count(name) as usertableCounts from 数据库名.dbo.sysobjects where xtype='U' and name<> 'dtproperties'
经过测试可用。