查询某个时间段内的所有TFS代码提交记录
代码如下,没那么多废话哈。
/* --查询某个时间段内的所有TFS代码提交记录 --2014.11.27 --万泽贵 */ --DROP PROC prc_QueryCommitedHistoryByLocalTime CREATE PROC prc_QueryCommitedHistoryByLocalTime ( @start DATETIME ,@end DATETIME ) AS BEGIN WITH cte AS ( SELECT * ,DATEADD(HOUR, DATEDIFF(HOUR, GETUTCDATE(), GETDATE()), CreationDate) cndate --将UTC转成localTime FROM tbl_ChangeSet ) SELECT a.ChangeSetId AS [变更集] ,c.AccountName AS [用户] ,a.cndate AS [提交日期] ,a.Comment AS [注释] FROM cte a INNER JOIN tbl_VCIdentityMap b ON a.OwnerId = b.IdentityId AND b.PartitionId = a.PartitionId INNER JOIN tfs_Configuration.dbo.tbl_Identity c ON c.PartitionId = b.PartitionId AND c.Id = b.TeamFoundationId WHERE a.cndate >= @start AND a.cndate <= @end ORDER BY a.cndate DESC END --prc_QueryCommitedHistoryByLocalTime '2014-11-26','2014-11-27'