TFS Database Queries


/ Published in: SQL
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. USE TfsVersionControl
  2.  
  3. SELECT DISTINCT
  4. DisplayName AS userName ,wksp.WorkspaceName,wksp.LastAccessDate,
  5. pc.TargetChildItem AS Item, pc.TargetParentPath AS tfspath,
  6. REPLACE(lv.LocalItem,'>','') AS localFile,
  7. LOCK.LockType,LOCK.LockStatus,
  8. pc.PendingChangeId,pc.PendingCommand,pc.VersionFrom
  9. FROM tbl_identity AS u
  10. JOIN dbo.tbl_Workspace wksp ON u.Identityid = wksp.OwnerId
  11. JOIN dbo.tbl_PendingChange pc ON pc.WorkspaceId = wksp.WorkspaceId
  12. JOIN dbo.tbl_Lock LOCK ON LOCK.LockStatus = pc.LockStatus
  13. JOIN dbo.tbl_LocalVersion lv ON pc.ItemId = lv.ItemId
  14. AND wksp.WorkspaceId = lv.WorkspaceId
  15.  
  16. WHERE wksp.WorkspaceName = 'Myworkspace'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.