****** Script for SelectTopNRows command from SSMS ******/SELECT TeamProjectProjectNodeName 项目名称 ,checkedinbyname 开发人员 ,SUM([LinesAdded]) AS 代码添加行数 ,SUM([LinesModified]) AS 代码修改行数 ,SUM([LinesAdded]+[LinesModified]) AS 代码变动行数 ,CONVERT(VARCHAR(10), MIN(DateTime),120) AS 开始时间 ,CONVERT(VARCHAR(10),MAX(DateTime),120) AS 结束时间 FROM [Tfs_Warehouse].[dbo].[CodeChurnView] WHERE TeamProjectProjectNodeName='深大购物P2P平台' AND ChangesetTitle NOT LIKE '%分支' AND FilenameFileExtension IN('.css','.cs','.aspx','.sql','js','.ascx') AND (LinesDeleted <>0 OR LinesModified<>0 OR FilenameFilePath LIKE '$/深大购物P2P平台/项目/01产品工作项/%' AND FilenameFileExtension IN('.sql')) AND NetLinesAdded>=0 GROUP BY TeamProjectProjectNodeName, checkedinbyname ORDER BY 代码变动行数 DESC
执行以上语句须有访问Tfs_Warehouse数据库的权限