--SQL查询每个表的字段数量select b.[name], count(*) As AllCount,ISNULL(ISNULL(sum(case when isnullable=0 then 1 end),null),null) as NotNullCountfrom syscolumns aINNER JOIN( select [id], [name] from [sysobjects] where [type] = 'u' ) AS b ON a.id = b.[id] GROUP b…
--例如: id NAME VALUE 1 a pp 2 a pp 3 b iii 4 b pp 5 b pp 6 c pp 7 c pp 8 c iii --id是主键 --要求得到这样的结果 id NAME VALUE 1 a pp 3 b iii 4 b pp 6 c pp 8 c iii --方法1 DELETE YourTable WHERE [id] NOT IN (SELECT MAX([id]) FROM YourTable GROUP BY (NAME + VALUE)) --…
在做数据导出时候,当某个表某字段含有单引号时候老是报错,所以要排除这种情况: sql查询某表某字段值带单引号情况 select 主键码 from 馆藏书目库 where 题名 like '%''%' 导出数据时候最好10W导一次,每次导10W. 最后警告自己一次,遇到问题自行解决,别问别人,免得别人给你脸色看,切记切记切记!!!!!!!!…