Find Shelf Locations tied to Item Templates

You cannot delete Shelf Locations if they are being used in item templates. This SQL will show you which item templates are using which Shelf Locations for a particular LIBRARY (not BRANCH) orgid.

SELECT
    it.ItemTemplateID as templateid,
	it.name AS templatename,
    sl.Description AS shelflocation
FROM
    Polaris.polaris.ItemTemplates it
JOIN
    polaris.Polaris.ShelfLocations sl ON sl.ShelfLocationID = it.ShelfLocationID
JOIN
	polaris.polaris.Organizations orgs on orgs.OrganizationID = sl.OrganizationID
WHERE
	orgs.ParentOrganizationID = 6 and ---enter LIBRARYID here
	sl.OrganizationID = it.AssignedBranchID
ORDER BY
    sl.Description

You can also use this Item Template Find Tool SQL to find all templates where the Shelf Location matches a particular description:

SELECT ItemTemplateID from polaris.polaris.ItemTemplates
where ShelfLocationID in (
select ShelfLocationID from polaris.polaris.ShelfLocations where Description like '%Easter%')

Hi @wesochuck.  Noting the two approaches and not knowing anything about the Polaris Find Tool, does its version of SQL not support joins?  Just a matter of casual interest; reply at your leisure, thanks.

It does support joins (there are other limitations), but my laziness and poor SQL skills know no bounds :wink: One part of it was from something we “developed” years ago.