Return to Snippet

Revision: 47489
at June 9, 2011 03:09 by michanne


Initial Code
use TfsVersionControl

select distinct
	DisplayName as userName ,wksp.WorkspaceName,wksp.LastAccessDate,
	pc.TargetChildItem as Item, pc.TargetParentPath as tfspath,
	replace(lv.LocalItem,'>','') as localFile,
	lock.LockType,lock.LockStatus,
	pc.PendingChangeId,pc.PendingCommand,pc.VersionFrom
from tbl_identity as u
join dbo.tbl_Workspace wksp on u.Identityid = wksp.OwnerId
join dbo.tbl_PendingChange pc on pc.WorkspaceId = wksp.WorkspaceId
join dbo.tbl_Lock lock on lock.LockStatus = pc.LockStatus
join dbo.tbl_LocalVersion lv on pc.ItemId = lv.ItemId
	and wksp.WorkspaceId = lv.WorkspaceId

where wksp.WorkspaceName = 'Myworkspace'

Initial URL


Initial Description
Sometimes it is just more convenient to query the db. Returns Pending changes with local path. Have not investigated what lock status translates to.

Initial Title
TFS Database Queries

Initial Tags


Initial Language
SQL