TFS 查询 - 如何确定谁创建了共享查询以及何时创建 [英] TFS Queries - How to determine who created a shared query and when
问题描述
我们正在使用 TFS 2012,并且由于监督不力,随着时间的推移创建了数百个共享查询.为了清理这些并提供一组通用的共享查询,我们想确定谁创建了查询以及创建时间,类似于工作项类型历史记录.
We are using TFS 2012 and have hundreds of Shared Queries that have been created over time due to poor oversight. In order to clean these up and provide a common set of shared queries, we'd like to determine who created the queries and when, similar to work item type history.
有没有办法在 TFS UX 中找到这些信息,使用扩展或查询数据库?
Is there a way to find this information in the TFS UX, using an extension or querying the DB?
推荐答案
您可以通过查看查询的安全性在 Team Web 中找到查询的所有者,但不会显示创建日期.
You can find the owner of a query in Team Web by looking at the security of a query, but it doesn't show the create date.
您需要的数据存储在每个集合数据库的QueryItems
表中.
The data you need is stored in the QueryItems
table of each collection db.
因此,您应该能够从如下所示的 sql 查询中获取此信息,只需更改集合 db 的 db 名称即可.
So, you should be able to get this information from a sql query like below, just change out the db names for your collection db.
SELECT t.Name as 'ProjectName'
,qi.[Name] as 'Query Name'
,[Text]
,[CreateTime]
,[LastWriteTime]
,c.DisplayPart as 'Owner'
FROM [TFS_DefaultCollection].[dbo].[QueryItems]qi
Left Join [TFS_DefaultCollection].[dbo].[Constants] c on c.TeamFoundationId=qi.OwnerIdentifier
Left join [TFS_DefaultCollection].[dbo].[TreeNodes] t on t.ID=qi.ProjectId
Where fPublic=1 and fFolder=0
这篇关于TFS 查询 - 如何确定谁创建了共享查询以及何时创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!