ODBC guide

Delete work items by WIQL query


Deletes all work items that match a WIQL query. The query in WITH defines which items are removed (e.g. by project and a list of IDs). Run a SELECT with the same query first to confirm the set of items before deleting.

DELETE FROM WorkItems
Where 1=1 
WITH(Query='SELECT * FROM WorkItems Where [System.TeamProject]=''MyProject'' AND ([System.Id]=6469 OR [System.Id]=6468) ')